当前位置:网站首页>DNS series (I): why does the updated DNS record not take effect?

DNS series (I): why does the updated DNS record not take effect?

2022-07-07 21:53:00 Shoot the clouds again

If we want to access the content on another machine while surfing the Internet , Usually you only need to enter a list of addresses directly , for example :www.upyun.com, You can accurately access the website you want to visit . But in fact, this is just a character form of network logo that is convenient for us to remember , What really allows our machine to communicate with another machine is IP Address . It's just IP The address is very troublesome both in input and memory , Therefore, the domain name system was born . So how does the domain name connect to that server IP Well ? This is similar to the domain name system we are going to talk about today DNS It's about .

DNS What is it? ?

Because a meaningful name can represent the account number of the host 、 Nature of work 、 Region and organization , So as to facilitate memory and use . So users will prefer to identify the host by name ,DNS It is developed for this need .DNS On behalf of the domain name system (Domain Name System). The system will put the domain name (example.com) Translate into actual IP Address .

DNS The logical structure of is a hierarchical domain name tree , from Internet Network Information Center (InterNIC) Manage the root of the domain name tree , be called “ Root region ”, Period for root field “.” Express , But this is usually omitted . It should be noted that there are only 13 platform IPv4 Root domain server .

Below the root domain is the top-level domain (TLD), It is divided into national top-level domains (ccTLD) And general top-level domain (gTLD). The country top-level domain uses the country and region abbreviation code , for example “cn” On behalf of China . Common top-level domains are common com/net/org etc. .

Below the top-level domain is the secondary domain , This is the only name officially registered to organizations and individuals , for example www.upyun.com Medium upyun It's the domain name registered in the cloud . Under the secondary domain , Organizations can also be divided into sub domains , Used by all branches . But the standard stipulates , The length of a domain name usually does not exceed 63 Characters , Not more than 255 Characters .

Yes, of course ,DNS It can not only point to IP Address , It also supports other forms of records . common DNS The record forms are :

  • A Record : Domain IPv4 A record of the address .

  • AAAA Record : Domain IPv6 A record of the address .

  • CNAME Record : Alias , Forward one domain or subdomain to another , Does not provide IP Address .

  • MX Record : Direct mail to e-mail server .

  • TXT Record : Enables administrators to store text notes in records .

  • NS Record : Storage DNS The name of the entry server .

A distinctive domain name , It allows users to brand the company “ It's deep in my mind ”. Although the domain name may be eternal , But record the address pointed to and used DNS The server will change frequently because of the demand . Sometimes we will encounter changes DNS After recording , The address actually accessed is not updated , This involves DNS spread .

What is? DNS spread ?

Generally, we record the domain name resolution of the website or DNS After the service provider changes , It will take some time for all servers in the world to adopt new record values , This period of time may be a few hours , It could be a few days , This transitional stage is DNS spread .

DNS Cause of transmission DNS The load of the server varies . The older the server, the longer it takes to update , So during the transition , It will appear that other providers have used the new address , But the service providers of some old servers may not have updated . This is because continuous query of new addresses will lead to excessive load , therefore DNS The server will not temporarily store the update information in the cache , Only when all servers have updated this cache , Will synchronize the new address in all places .

In addition to server load , There are also some factors that can affect DNS spread .

influence DNS Factors of communication

DNS Areas and TTL value

DNS Divided into many different areas , yes DNS Part of the namespace , Managed by a specific organization or administrator . Area files are stored in DNS Plain text files in the server , It contains the actual representation of the region , And all records of each domain in the region .

We can create a zone file for each domain name DNS Set up TTL.TTL representative “ Time to live ”, Server cache DNS Time period of information . It can define and set temporary cache 、 How long to store and when to update .TTL Value for DNS Communication is crucial , If TTL The value is 24 Hours , After the change 1 Genius can work . Of course , In order for the update to take effect faster , We can adjust TTL value . however , This adjustment must be made before the update , Because adjustment TTL Also belong to DNS spread , It will also take some time to take effect . In addition, be careful not to DNS TTL Set to 0, Because there is no number defined in the standard 0, It can lead to DNS Information is ignored or rejected .

If you use cloud resolution to modify the resolution record of the domain name , The final effective time depends on the local operators DNS Server cache refresh time , In general, it is equivalent to setting the resolution TTL Time . For example, in parsing settings TTL The value is 10 minute , After modifying the resolution, it will be in 10 Take effect globally within minutes .

If it is a modification DNS The server , Then the effective time depends on the local DNS Cached domain name DNS The name of the server TTL Time , for example “.com” The top-level domain is 48 Hours ,“.cn” yes 24 Hours . Because different top-level domains DNS Server's TTL Time is different , So in theory, change the domain name DNS Server global resolution takes the longest time to take effect 48 Hours .

ISP(Internet Service provider )

Another effect DNS The factor of propagation duration is the use Internet Service provider (ISP).ISP Will DNS Data is cached locally , Each request retrieves data in the cache instead of DNS The server . The advantage of this approach is faster response , At the same time, it also reduces the generation of data traffic . however , This may be good for DNS Communication has an impact . Besides , some ISP Will directly ignore TTL Set up , And the cache record is updated every two to three days .

Location of the server

The location of the server will also be right DNS Communication has an impact . The recorded changes can be made in the nearest DNS The server takes effect , But it usually takes longer to get to servers on the other side of the world . Because different servers need to notify each other one by one of the changes in records . And as mentioned in Article 2 , Because some servers may only update within a specific time interval , As a result, all updates will take a long time .

DNS The time of transmission

That's actually DNS How long does it take to spread ? The local server is usually updated in a few minutes or hours . however , Let all servers around the world know about these changes , And it may take quite a long time to make it effective , Usually 1 to 2 It is possible to take effect within days . And according to the settings of the service provider , It may also appear 72 It will be updated after hours . therefore , When you need to change or switch records , Arrange ahead of time DNS Communication is very important .

In some cases ,DNS Communication will have an impact on website access , There is no way to avoid it completely , However, there are some ways to minimize the duration . For example, changing DNS Before server , We can modify the TTL value , Make it smaller . etc. TTL After value update , Revise DNS The server . But even if it hasn't been spread , It also does not affect the modification of domain name resolution records . Even if DNS The server is still old , But the parsing record will be updated in real time , The website content will also be up-to-date .

Yes, of course , If the parsing record is modified , After that TTL Time discovery or access to old records , You can try clearing the local DNS cache . Or locally changed to public DNS (114.114.114.114/8.8.8.8) Try again later .

DNS Dissemination inspection

If there is no tool to determine the website DNS Whether the communication has been completed . Several local DNS Conduct DNS Spread the method of inspection to confirm . for example ,Windows、macOS and Linux Installed by default nslookup, It can display the current DNS The resolution status of the server .Dig Tools are also a good choice .

In addition to local queries , Other external DNS Check by selecting a random server and querying there DNS Information to test . Because servers are distributed all over the world , So we can't 100% determine DNS Dissemination has been completed everywhere , But at least we can confirm the general spread . for example , Use Myssl Of DNS Detection tools (https://myssl.com/dns_check.html#dns_check), It can quickly find out the speed of domain name resolution in different regions and Networks , And the domain name DNS Information .

Read here , Are you right DNS There is an answer to the question that the amendment does not take effect ? Conduct DNS Server or domain name system related changes , Still give priority to DNS spread . Though it can be done by TTL Reduce propagation time , But due to some unstable factors , It will still take some time for every server in the world to change to the latest state .

What is walking index ?

About GIN Routing tree

原网站

版权声明
本文为[Shoot the clouds again]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071431506210.html