This article is a mirror article of machine translation, please click here to jump to the original article.

View: 16451|Reply: 2

[windows] How often does the Windows DNS cache flush?

[Copy link]
Posted on 12/6/2017 10:19:45 AM | | | |
DNS is a "word" that we are all very familiar with, there is a DNS cache in the Windows system, and DNS resolution is the actual addressing method for most applications on the Internet. The redevelopment of domain name technology and a variety of applications based on domain name technology have enriched Internet applications and protocols, and with DNS can not only improve our Internet speed, but also improve the speed of opening web pages. However, the DNS cache is time-limited, and it will be automatically refreshed at a certain time.
For example, when we visit a website for the first time, DNS will return the correct IP, and the system will temporarily store this result, which is DNS caching. The cache sets an expiration time, such as 2 hours, when we close the site after 2 hours, the system will directly return the result to you from the local DNS cache of your computer, without having to ask the DNS server, which "accelerates" the resolution of the URL in disguise. Of course, after more than N hours, the system will automatically ask the DNS server again to get new results.

By default: The default value for Windows DNS cache is MaxCacheTTL, here, it defaults to 86400s, which is a day, and macOS strictly follows the TTL in the DNS protocol!

However, unlike Windows systems, browser DNS cache time is independent of TTL, and each browser has a fixed value. The following are the cache times of common browsers:



1. Chrome Google Chrome
To speed up access, Google Chrome uses the method of pre-fetching DNS records and establishing a DNS cache locally to speed up the website's connection.
chrome://net-internals/#dns 这里可以看各域名的DNS 缓存时间。Chrome对每个域名会默认缓存60s。

2. IE browser
IE caches DNS for 30 minutes.

3. Firefox Firefox
Firefox has a DNS caching function, but the default cache time is only 1 minute, you can change the default value to speed up DNS resolution, as follows:
Open a new window, enter about:config in the address bar, enter enter, and enter the settings interface. Then search for network.dnsCacheExpiration, change the original 60 to 6000 (indicating 6000 seconds of cache), and then search network.dnsCacheEntries to change the default 20 to 1000 (for 1000 caches). If there are no above two items, you can create new them, and the new entry type is integer. Of course, you can also set other values as needed.

4. Safari is the default browser in the Apple system
About 10s
To ensure high availability of the service, DNS requires redundancy of multiple name servers to support each region. Resource records for a zone are manually or automatically updated on a single primary nameserver, known as the primary DNS server, which can be an authoritative nameserver for one or more zones.
Parsing typically involves traversing multiple name servers to find the information you need. However, some parsers function more simply by communicating with just one name server. These simple parsers rely on a recursive name server (called a "stub parser") to find the execution work for them to find information.
For example, Chrome will first make an HTTP request to the first IP, and if it doesn't work, it will make an HTTP request to the next IP
Date: 2014-11-21T17:13+0800  Author: CobbLiu   Org version 7.9.3f with Emacs version 24




Previous:A development tool essential for a good full-stack engineer
Next:The earth is down, the earth is down
 Landlord| Posted on 12/6/2017 10:27:40 AM |
How to disable client DNS caching in Windows XP and Windows Server 2003

https://support.microsoft.com/zh-cn/help/318803/how-to-disable-client-side-dns-caching-in-windows-xp-and-windows-serve

To view the DNS resolver cache, type ipconfig /displaydns at the command prompt

 Landlord| Posted on 12/6/2017 10:40:46 AM |

DNS server resolution returns the IP allocation policy and the client selects the domain name IP policy
A simple test to resolve 163 domain names first

C:\Users\itsvse>nslookup www.163.com
Server: ns4.zj.chinamobile.com
Address:  211.140.188.188

Non-authoritative response:
Name: c01.i05.cmbzj.hadns.net
Addresses:  111.1.38.160
          111.1.38.159
          223.94.95.114
          223.94.95.119
Aliases:  www.163.com
          www.163.com.cloudcdn.net
          c01.i05.hacdn.net



You can see that the domain name has returned multiple IPs, and the DNS server will have some policies to ensure that the customer accesses the load balancing or speed guarantee of the server, such as IP random return, return by the nearest IP to the user, etc., and its main control strategy is to adjust the first returned IP in the list.

Generally, the client (such as a browser) chooses the IP returned by DNS to take the first IP, and if the first IP fails, it will take the second IP. There are also clients that fail directly after connecting to the first IP.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com