如何清除DNS缓存(Mac,Windows,Chrome)

Have you even been asked to clear your DNS cache? It is a troubleshooting tip that helps you get to the latest version of a website, particularly after DNS changes.

您甚至被要求清除DNS缓存吗? 它是一个故障排除技巧,可帮助您获取网站的最新版本,尤其是在DNS更改之后。

DNS information tells your browser where to find a website. Your computer keeps this information in its cache to quickly point browsers in the right direction.

DNS信息告诉您的浏览器在哪里可以找到网站。 您的计算机会将这些信息保留在其缓存中,以使浏览器快速指向正确的方向。

In this article, we’ll show you how to clear your DNS cache on Mac, Windows, and Chrome. This will allow you to easily refresh DNS records stored on your device and help you troubleshoot website issues.

在本文中,我们将向您展示如何在Mac,Windows和Chrome上清除DNS缓存。 这将使您轻松刷新存储在设备中的DNS记录,并帮助您解决网站问题。

Easily clear DNS cache in macOS, Windows, and Chrome

Here is a quick overview of what we’ll cover in this guide:

以下是我们将在本指南中介绍的内容的快速概述:

什么是DNS缓存? (What is DNS Cache?)

DNS cache is like an address book saved on your computer with the domain name server (DNS) information of each website you visit.

DNS缓存就像保存在计算机上的通讯录,其中包含您访问的每个网站的域名服务器(DNS)信息。

DNS or Domain Name Server is a technology that tells your computer the IP address associated with a domain name. To learn more, see our guide on how domain names work.

DNS或域名服务器是一项告诉您的计算机与域名关联的IP地址的技术。 要了解更多信息,请参阅我们的域名指南。

Saving the DNS information in a local DNS cache helps your browser quickly find a website.

将DNS信息保存在本地DNS缓存中可帮助您的浏览器快速找到网站。

Once you enter a website address in your browser, it will look for DNS information in the local cache first. If it finds the directions, then it uses the DNS cache to visit the website.

在浏览器中输入网站地址后,它将首先在本地缓存中查找DNS信息。 如果找到方向,则使用DNS缓存访问网站。

On the other hand, if the information is not in the local DNS cache, then the browser will get it from other DNS servers across the internet.

另一方面,如果信息不在本地DNS缓存中,则浏览器将从Internet上的其他DNS服务器获取信息。

This ensures that every time you visit any website, your browser takes the shortest route to get the DNS information it needs to locate the website on the internet.

这样可以确保每次访问任何网站时,浏览器都会采用最短的路径来获取在互联网上定位该网站所需的DNS信息。

How domain names and DNS work

However, this may sometime cause trouble. For example, when you are moving a WordPress site to a new domain name or when you are moving WordPress to a new host.

但是,这有时可能会引起麻烦。 例如,当您将WordPress网站移至新域名将WordPress移至新主机时

DNS information may not get updated quickly on your computer, and you may end up visiting the old website or see a not found error. It will eventually get updated, but why wait when you can clear DNS cache right away.

DNS信息可能无法在您的计算机上快速更新,并且您可能最终访问了旧网站或看到未找到的错误。 它最终将被更新,但是为什么要等一下就可以立即清除DNS缓存。

Let’s take a look at how to clear DNS cache across various platforms.

让我们看一下如何清除各种平台上的DNS缓存。

如何在Windows中清除DNS缓存 (How to Clear DNS Cache in Windows)

If you are using a windows computer, then here is how you would clear DNS cache on your device.

如果您使用的是Windows计算机,则可以通过以下方法清除设备上的DNS缓存。

First, you need to click on the start button and select the CMD (command prompt) tool.

首先,您需要单击开始按钮并选择CMD(命令提示符)工具。

Opening command prompt in Windows

This will launch a command prompt window. Inside it you need to enter the following text:

这将启动命令提示符窗口。 在其中,您需要输入以下文本:

ipconfig /flushdns

ipconfig /flushdns

Clearing DNS cache in Windows

Click on the enter button to execute the command and Windows will flush the DNS cache.

单击输入按钮以执行命令,Windows将刷新DNS缓存。

That’s all, you can now resume visiting your website to fetch the updated DNS information.

就是这样,您现在可以继续访问您的网站以获取更新的DNS信息。

如何在macOS上清除DNS缓存 (How to Clear DNS Cache on macOS)

If you are on a Mac computer, then follow the steps below to clear your DNS cache.

如果您使用的是Mac计算机,请按照以下步骤清除DNS缓存。

First, you need to launch the Terminal app. You can find it in the Launchpad under the ‘Other’ folder. You can also launch it by opening Finder and going to Applications » Utilities folder.

首先,您需要启动终端应用程序。 您可以在“其他”文件夹下的启动板中找到它。 您也可以通过打开Finder并转到Applications»Utilities文件夹来启动它。

Launching terminal

This will launch the terminal window where you need to enter the following command.

这将启动终端窗口,您需要在其中输入以下命令。

sudo killall -HUP mDNSResponder

sudo killall -HUP mDNSResponder

Clearing DNS cache using terminal on macOS

You’ll be asked to enter your macOS account password. It is the same password you use to log into your computer.

系统将要求您输入macOS帐户密码。 与您登录计算机时使用的密码相同。

After that, your computer will flush the DNS cache. You can now visit the website to get the latest DNS information.

之后,您的计算机将刷新DNS缓存。 现在,您可以访问该网站以获取最新的DNS信息。

清除Chrome中的DNS缓存 (Clear DNS Cache in Chrome)

Google Chrome also keeps a DNS cache of its own, and it is separate from the DNS cache stored by your operating system.

Google Chrome浏览器还保留自己的DNS缓存,并且与操作系统存储的DNS缓存是分开的。

If you use Google Chrome as your main browser, then you’ll need to clear Chrome’s DNS cache as well.

如果您使用Google Chrome浏览器作为主浏览器,则还需要清除Chrome浏览器的DNS缓存。

First, you need to enter the following address in your browser’s address bar and press enter on your keyboard.

首先,您需要在浏览器的地址栏中输入以下地址,然后按键盘上的Enter键。

chrome://net-internals/#dns

chrome://net-internals/#dns

Clearing Google Chrome DNS cache

This will load Chrome’s net internal settings page. From here you need to click on the ‘Clear host cache’ button, and Chrome will clear up its DNS cache.

这将加载Chrome的网络内部设置页面。 在这里,您需要单击“清除主机缓存”按钮,然后Chrome将清除其DNS缓存。

Now keep in mind that DNS cache is separate from the browser cache.

现在请记住,DNS缓存与浏览器缓存是分开的。

Your browser saves a lot of website data in a temporary cache to quickly load pages on subsequent visits.

您的浏览器将大量网站数据保存在临时缓存中,以在以后的访问中快速加载页面。

If you are having trouble viewing a page that you updated but can’t see your changes, then you would want to clear the browser cache.

如果您在查看更新后的页面时遇到麻烦,但是看不到更改,则需要清除浏览器缓存。

We have a step by step guide on how to clear browser cache on all major browsers that you can follow.

我们提供了有关如何清除所有可以遵循的主要浏览上的浏览器缓存的分步指南。

如何检查DNS更新 (How to Check for DNS Updates)

When you are moving your WordPress website to a host or transferring your domain registration to a new domain registrar, you’ll have to change your DNS settings and point them to the new location.

当您将WordPress网站移动到主机上或将域名注册转移到新的域名注册机构时 ,您必须更改DNS设置并将其指向新位置。

Once you apply these changes under your domain settings, it takes a while for changes to propagate across the internet. This could take anywhere between a few hours to a couple of days.

在域设置下应用这些更改后,更改将需要一段时间才能在Internet上传播。 这可能需要几个小时到几天不等。

During this time, your domain will sometime point to the old location and sometimes it will point to the new location. This depends on your geographic location and which DNS servers your browser asks for directions.

在此期间,您的域有时会指向旧位置,有时会指向新位置。 这取决于您的地理位置以及浏览器询问方向的DNS服务器。

You can check how these DNS changes are propagated around the world using online tools like DNS Checker.

您可以使用DNS Checker等在线工具检查这些DNS更改如何在世界范围内传播。

Simply enter your domain name, and it will fetch DNS from different geographic locations spread around the world.

只需输入您的域名,它就会从遍布全球的不同地理位置获取DNS。

Check for DNS updates

If all locations indicate the same IP address with a green checkmark, then this means the DNS changes you made are now updated all over the internet.

如果所有位置都用绿色选中标记指示相同的IP地址,则意味着您所做的DNS更改现在将在整个Internet上更新。

We hope this article helped you learn how to easily clear your DNS cache on different devices. You may also want to see our guide on how to clear your WordPress cache for beginners.

我们希望本文能帮助您学习如何轻松清除不同设备上的DNS缓存。 您可能还希望查看我们的指南,以了解如何为初学者清除WordPress缓存

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-clear-your-dns-cache-mac-windows-chrome/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值