Talking about how to locate URL path resources

1. What is a URL

Uniform resource locator is a subset of URI. In addition to identifying the location of a resource, it also provides a main access mechanism for locating the resource (such as its network location), that is, it provides a specific way to find the resource (location + method), It consists of three parts:

  • Protocol or service method (such as http, https...)
  • The IP address of the host where the resource is stored (sometimes including the port number)
  • The specific address of the host resource (such as directory and file name, etc.)

Second, what is DNS

DNS is a computer and network service naming system organized into a domain hierarchy. It is used in TCP/IP networks. The services it provides are used to convert host names and domain names into IP addresses. DNS is such a "translator"

3. DNS resolution process

  1. Check whether the ip address corresponding to the domain name has been cached in the browser cache
  2. If the ip is not found in the browser cache, it will continue to find whether the local system has cached the ip
  3. Initiate a domain name resolution request to the local domain name resolution service
  4. Initiate a domain name resolution request to the root domain name resolution server
  5. The root domain name server returns the address of the gTLD (general top-level domain) domain name resolution server
  6. Initiate a resolution request to the gTLD server
  7. The gTLD server receives the request and returns to the Name Server server
  8. The Name Server server returns the ip address to the local server
  9. The local domain name server caches the resolution result
  10. Return the analysis result to the user DNS resolution process

Fourth, what happened after entering the URL

  1. The browser requests the DNS server to resolve the IP address corresponding to the domain name in the URL
  2. After the IP address is resolved, a TCP connection is established with the server based on the IP address and the default port 80
  3. The browser sends an HTTP request to read the file (the file corresponding to the domain name in the URL), and the request message is sent to the server as the third message of the TCP three-way handshake.
  4. The server responds to the browser request and sends the corresponding html text to the browser to release the TCP connection
  5. The browser parses the HTML text and renders it locally

Guess you like

Origin blog.csdn.net/qq_45621376/article/details/115284668