This is the 15th day of my participation in the August More Text Challenge. For details, see: August More Text Challenge;

Writing in the front

This is the first step in the browser render, DNS Domain Name resolution, the Domain Name System (DNS) is the naming System used on the Internet to convert human-friendly machine names into IP addresses. In this article we are going to talk about how DNS resolves domain names.

Internet Domain name structure

Before understanding how to resolve the domain name, we also need to understand the structure of the domain name, such as www.juejin.cn, where cn is a top-level domain name, juejin is a secondary domain name, and WWW is a tertiary domain name.

The lowest-level domain name is written on the far left, while the highest-level character is written on the far right. A full domain name consisting of multiple labels contains no more than 255 characters in total.

Domain name Resolution Rules

When we know the structure of Internet domain names, we can understand the rules of domain name resolution.

There is a root DNS in the Internet, which is the highest level of DNS and the most important DNS server. All root DNS servers know the domain names and IP addresses of all top-level DNS servers.

The browser sends a request to the root DNS server to obtain the IP address of the TOP-LEVEL DNS server, then sends a request to the root DNS server to obtain the IP address of the secondary DNS server, and then obtains the IP address of the host name (that is, the third-level domain name) based on the secondary DNS server.

Through this recursive lookup process, the browser can accurately obtain the IP address of the requested resource.

DNS cache

Have you noticed that when we open a page, it seems to open a little faster than the first time? There is also a cache of static resources. Of course, there is also a DNS cache, which is used by the browser after obtaining the actual IP address of a website’s domain name to reduce the consumption of subsequent network requests.

conclusion

In fact, the process of DNS addressing is like, if we want to find a front-end engineer named Zhang SAN in a certain company, we go to the company, we ask for the department of Zhang SAN, we go to the department to find the front-end department, we find zhang SAN.

At the moment, when you get a glass of water after finding Zhang SAN, you can go back to the office and find Zhang SAN without going through the company, and this is the DNS cache.

Today we have a brief look at how DNS resolves domain names in the browser render, and then we will learn how to set up TCP connections, HTTP connections…

The front is a long distance, we are all on the road, hope to communicate with friends, progress together. Keep updating ing…..