(Are)您在上网时是否遇到问题?您尝试访问的网站是否打不开?如果您无法访问该网站,则此问题背后的原因可能是由于 DNS服务器及其解析缓存。
DNS 或域名系统(Domain Name System)是您在线时最好的朋友。它将您访问的网站的域名转换为IP地址,以便机器可以理解它。假设(Suppose)您访问了一个网站,并且您使用它的域名来执行此操作。浏览器会将您重定向到DNS服务器,并将存储您正在访问的网站的 IP 地址。在本地,在您的设备内部,有所有 IP 地址的记录(record of all the IP addresses),即您访问过的网站。每当您再次尝试重新访问该网站时,它将帮助您比以前更快地收集所有信息。
所有 IP 地址都以缓存的形式存在于DNS Resolver Cache中。有时,当您尝试访问该站点时,您并没有获得更快的结果,而是根本没有结果。因此,您需要刷新重置的 DNS 解析器缓存以获得正输出。 ( Therefore, you need to flush the reset DNS resolver cache for getting the positive output. )有一些常见的原因会导致DNS缓存随着时间的推移而失败。该网站可能已更改其 IP 地址,因为您的记录有旧记录。因此,您可能拥有旧的 IP 地址,在您尝试建立连接时会导致问题。
另一个原因是以缓存的形式存储不良结果。有时这些结果会由于DNS 欺骗(DNS spoofing)和中毒而被保存,最终导致在线连接不稳定。也许该站点很好,问题出在您设备上的DNS缓存中。DNS缓存可能会损坏或过时,您可能无法访问该站点。如果发生任何这种情况,那么您可能需要刷新并重置DNS解析缓存以获得更好的结果。
就像DNS解析器缓存一样,您的设备上还有另外两个缓存,您可以根据需要刷新和重置它们。它们是内存缓存和缩略图缓存。(Memory cache and the Thumbnail cache.)内存缓存包括系统内存中的数据缓存。 缩略图(Thumbnail)缓存包含设备上图像和视频的缩略图,还包括已删除的缩略图。清除内存缓存会释放一些系统内存。清除缩略图缓存可以在硬盘上创建一些可用空间。
如何在Windows 10中刷新(Flush)和重置(Reset)DNS 缓存(DNS Cache)
有三种方法适用于在Windows 10中刷新(Windows 10)DNS解析器缓存。这些方法将解决您的互联网问题并帮助您建立稳定且有效的连接。
方法一:使用运行对话框
1.使用快捷键Windows Key + R打开( R)运行(Run)对话框。
2.在框中输入ipconfig /flushdns并点击OK按钮或Enter框。
3.屏幕上会出现一个cmd 框,确认(cmd box)DNS 缓存将被成功清除。(the DNS cache will get successfully cleared.)
方法 2:使用命令提示符
如果您不使用管理帐户登录Windows,请确保您有权访问该帐户,或者创建一个新的管理帐户,因为您需要管理员权限才能清除DNS缓存。否则,命令行将显示System 5 错误(System 5 error),您的请求将被拒绝。
使用命令提示符(Command Prompt),您可以执行与DNS缓存和 IP 地址相关的各种其他功能。其中包括查看当前的DNS缓存、在主机文件上注册DNS缓存、释放当前的 IP 地址设置以及请求和重置 IP 地址。您还可以仅使用一行代码启用或禁用DNS缓存。(DNS)
1. 在Windows 搜索(Windows Search)栏中键入 cmd然后单击“以管理员身份运行(Run as administrator)”以打开提升的命令提示符(Command Prompt)。请记住(Remember)以管理员身份运行命令行以使这些命令正常工作。
2. 出现命令屏幕后,输入命令ipconfig /flushdns并按Enter键。点击 Enter 后,您将看到一个确认窗口,确认DNS缓存刷新成功。
3. 完成后,验证DNS缓存是否已清除。输入命令ipconfig /displaydns并按Enter键。如果还有任何DNS条目,它们将显示在屏幕上。此外,您可以随时使用此命令检查DNS条目。
4、如果要关闭DNS缓存,在命令行中输入命令net stop dns cache,然后按回车(Enter)键。
5.接下来,如果要打开DNS缓存,在命令提示符中输入命令(Command Prompt)net start dnscache ,然后按回车(Enter )键。
注意:(Note:)如果您关闭了DNS缓存并忘记再次打开它,那么它会在您重新启动系统后自动启动。
您可以使用ipconfig /registerdns来注册Hosts 文件中存在的DNS缓存。(DNS)另一个是ipconfig /renew,它将重置并请求新的 IP 地址。要释放当前 IP 地址设置,请使用ipconfig /release.
方法 3:使用 Windows Powershell
Windows Powershell是(Windows Powershell)Windows 操作系统(Windows OS)上最强大的命令行。与使用命令提示符(Command Prompt)相比,您可以使用PowerShell做更多的事情。Windows Powershell的另一个优点是您可以清除客户端DNS缓存,而您只能在Command Prompt中清除本地(Command Prompt)DNS缓存。
1.使用运行对话框或Windows 搜索(Windows search)栏打开Windows Powershell 。
2. 如果要清除客户端缓存,请在 Powershell 中输入命令Clear-DnsClientCache 并按(Clear-DnsClientCache)Enter按钮。
3. 如果您只想清除桌面上的DNS缓存,请输入Clear-DnsServerCache并按Enter键。
如果DNS 缓存(DNS Cache)没有被清除或刷新怎么办?
有时,您可能无法使用命令提示符清除或重置(Command Prompt)DNS 缓存(DNS Cache),这可能是因为DNS缓存被禁用。因此,您需要先启用它,然后再再次清除缓存。
1. 打开运行(Run)对话框并输入services.msc并按 Enter。
2. 在列表中搜索DNS 客户端服务(DNS Client Service)并右键单击它并选择属性。(Properties.)
4. 在“属性(Properties)”窗口中,切换到“常规(General)”选项卡。
5. 将启动类型(Startup type)选项设置为自动,(Automatic,)然后单击确定(OK )以确认更改。
现在,尝试清除DNS缓存,您将看到该命令已成功运行。同样,如果您出于某种原因要禁用DNS缓存,请将启动类型更改为Disable。
受到推崇的:(Recommended:)
我们希望本文对您有所帮助,并且您能够在 Windows 10 中刷新和重置 DNS 缓存(flush & reset the DNS cache in Windows 10)。如果您仍有任何问题,请随时在评论部分提出。
How to Flush and Reset the DNS Cache in Windows 10
Are you facing issues while surfing the internet? Does the website you are trying to reach doesn’t open? If you’re unable to access thе website then the reason behind this issue might be because of the DNS server and its resоlving cache.
DNS or Domain Name System is your best friend while you are online. It converts the domain name of the website you visited into IP addresses so that the machine can understand it. Suppose you visited a website, and you used its domain name for doing this. The browser will redirect you to a DNS server and it will store the IP address of the website you are visiting. Locally, inside your device, there is a record of all the IP addresses, meaning the websites you have visited. Whenever you try to re-access the website again, it will help you gather all the information faster than before.
All the IP addresses are present in the form of a cache in DNS Resolver Cache. Sometimes, when you try to access the site, instead of getting faster results, you get no result at all. Therefore, you need to flush the reset DNS resolver cache for getting the positive output. There are some common reasons which cause the DNS cache to fail over time. The website may have changed their IP address and since your records have the old records. And hence, you may have the old IP address, causing problems while you are trying to establish a connection.
Another reason is the storing of bad results in the form of a cache. Sometimes these results get saved due to DNS spoofing and poisoning, ending up in unstable online connections. Maybe the site is fine, and the problem is in the DNS cache on your device. The DNS cache can get corrupt or outdated and you may not be able to access the site. If any of this has happened, then you may need to flush and reset your DNS resolve cache for better results.
Just like DNS resolver cache, there are two other caches present on your device, which you can flush and reset if needed. These are the Memory cache and the Thumbnail cache. Memory cache comprises a cache of data from your system memory. Thumbnail cache contains the thumbnails of the images and videos on your device, it includes the thumbnails of deleted ones also. Clearing the memory cache frees some system memory. While clearing the thumbnail cache can create some free room on your hard disks.
How to Flush and Reset the DNS Cache in Windows 10
There are three methods applicable for flushing your DNS resolver cache in Windows 10. These methods will fix your internet problems and help you with a stable and working connection.
Method 1: Use the Run Dialog Box
1. Open the Run dialog box using the shortcut key Windows Key + R.
2. Type ipconfig /flushdns in the box and hit the OK button or the Enter box.
3. A cmd box will appear on the screen for a moment and will confirm that the DNS cache will get successfully cleared.
Method 2: Using Command Prompt
If you don’t use an administrative account to login to the Windows, then make sure you have access to one or you create a new administrative account as you will require admin rights to clear the DNS cache. Else, the command line will show System 5 error and your request will get denied.
Using Command Prompt you can perform various other functions related to DNS cache and your IP address. These include viewing the current DNS cache, registering your DNS cache on host files, releasing the current IP address settings and also requesting & resetting the IP address. You can also enable or disable DNS cache with only one line of code.
1. Type cmd in Windows Search bar then click on “Run as administrator” to open the elevated Command Prompt. Remember to run the command line as an administrator for making these commands work.
2. Once the command screen appears, enter the command ipconfig /flushdns and hit the Enter key. Once you hit Enter, you will see a confirmation window appear, confirming the successful DNS cache flushing.
3. Once done, verify if the DNS cache is cleared or not. Enter the command ipconfig /displaydns and hit the Enter key. If there are any DNS entries left, they will get displayed on the screen. Also, you can use this command anytime to check the DNS entries.
4. If you want to turn off the DNS cache, type in the command net stop dns cache in the command line and press the Enter key.
5. Next, if you want to turn on the DNS cache, type the command net start dnscache in the Command Prompt and press the Enter key.
Note: If you turn off the DNS cache and forget to turn it on again, then it will automatically start after you restart your system.
You can use ipconfig /registerdns for registering the DNS cache present on your Hosts file. Another one is ipconfig /renew which will reset and request a new IP address. For releasing the current IP address settings, use ipconfig /release.
Method 3: Using Windows Powershell
Windows Powershell is the most powerful command line present on the Windows OS. You can do much more with PowerShell than you can do with the Command Prompt. Another advantage of Windows Powershell is you can clear client-side DNS cache while you could only clear local DNS cache in Command Prompt.
1. Open Windows Powershell using the Run dialog box or the Windows search bar.
2. If you want to clear the client-side cache, enter the command Clear-DnsClientCache in Powershell and hit the Enter button.
3. If you want to clear just the DNS cache on your desktop, enter Clear-DnsServerCache and hit the Enter key.
What if the DNS Cache is not getting cleared or flushed?
Sometimes, you may not be able to clear or reset DNS Cache using the Command Prompt, it may happen because the DNS cache is disabled. So, you need to first enable it before clearing the cache again.
1. Open the Run dialog box and enter services.msc and hit Enter.
2. Search for DNS Client Service in the list and right-click on it and select Properties.
4. In the Properties window, switch to the General tab.
5. Set the Startup type option to Automatic, and then click on OK to confirm the changes.
Now, try to clear the DNS cache and you will see that the command is running successfully. Similarly, if you want to disable the DNS cache for some reason, change the startup type to Disable.
Recommended:
We hope this article was helpful and you were able to flush & reset the DNS cache in Windows 10. If you still have any questions then feel free to ask them in the comment section.