DNS - Domain name resolution process

1. What is DNS

       DNS is the abbreviation of Domain Name System. It is composed of resolvers and domain name servers. DNS is the server that performs domain name resolution.

       A domain name server refers to a server that stores the domain names and corresponding IP addresses of all hosts in the network and has the function of converting domain names into IP addresses.

      A domain name must correspond to an IP address, and an IP address does not necessarily have a domain name.

2. What is DNS caching?

      Scenario: If you visit a certain URL many times in a short period of time, the DNS has to be resolved and returned to you many times, which is duplication of work.

      Countermeasure: The operating system has cleverly designed a local " DNS cache". When you visit 163.com for the first time , after DNS returns the correct IP , the system will temporarily store the result. This is the DNS cache.

      Features: And it will set an expiration time for the cache (for example, N hours), within these N hours, when you visit the website again, the system will directly return the result to you from your computer's local DNS cache , instead of having to ask the DNS server, it "speeds up" the resolution of the URL in disguise. Of course, after more than N hours, the system will automatically ask the DNS server again to obtain new results.

       Advantages: Speed ​​up the parsing of URLs.
       Disadvantage: When you modify the DNS server and do not want the computer to continue to use the previous DNS cache, you need to manually clear the local cache.

3. Enter a URL in the browser, the domain name resolution priority of hosts, DNS cache, DNS server?

        When the user enters the domain name in the browser and presses the Enter key,

        Step 1, the browser will check whether there is a resolved IP address corresponding to the domain name in the cache. If there is one in the cache, the parsing process will end.
        Step 2, if the user's browser cache does not have it, the browser will look up whether there is a DNS resolution result corresponding to the domain name in the operating system cache. In fact, the operating system will also have a domain name resolution process. In Windows, it can be set through the C:\Windows\System32\drivers\etc \ hosts file . You can resolve any domain name to any accessible IP address.
        The third step, the first two steps are all completed in this machine. The real domain name resolution server has not been involved yet. If the domain name resolution cannot be completed in the local machine, the domain name server will be really requested to resolve the domain name.

        Detailed domain name resolution process:  http://www.360doc.com/content/13/0527/17/11253639_288596772.shtml

4. How to clear DNS cache?

Enter ipconfig/flushdns         in cmd and    press Enter.

        http://jingyan.baidu.com/article/77b8dc7fcf466d6174eab600.html

       

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326849247&siteId=291194637
Recommended