When a user enters www.baidu.com in the address bar, the DNS resolution process is as follows:
-
The browser checks whether the cache resolves the IP address corresponding to the domain name. If yes, the resolution is complete. (The TTL property can be used to set the cache time of the domain name.)
-
If no match is found in the browser cache, the browser checks the OPERATING system for an IP address corresponding to the resolved domain name. The operating system also has a domain name resolution process, which can be set in The hosts file on the C disk in Windows.
-
If no match is found in the operating system, the system requests the local DNS server to resolve the domain name. (This server is somewhere in your city and caches most domain name resolution results.)
-
If no match is found on the local DNS Server, the system sends a request for resolution to the Root Server.
-
The Root Server returns the queried primary DNS Server (top-level DNS Server,.com, etc.) address to the local DNS Server.
-
The local DNS server sends requests to the primary DNS server.
-
The requested top-level domain Name Server looks up and returns the address of the Name Server corresponding to the domain Name. This Name Server is the domain Name Server registered for the site.
-
The Name Server finds the target IP address based on the mapping table and returns the IP address to the local DNS Server.
-
The local DNS server caches this corresponding IP address.
-
The local DNS server returns the resolution result to the user. The user caches the resolution result to the local system cache based on the TTL value. The domain name resolution ends.