The Internet is complex.
The process to load a website is no different.
It takes 100 or more back and forth communications between your web browser and the server you are requesting from. Also, the URL you type is not machine readable. Also, your browser needs to know where to request a website from.
This process is all done in the domain name system. Communication that turns a human readable URL into a machine readable address.
It is a phone book for the Internet.
What is Domain Name System (DNS)?
The domain name system (DNS) is how a web browser requests a website. DNS is the Internet’s phone book, although phone books are a bit out of date.
The reason DNS gets the phone book analogy is that it turns human-readable web addresses into machine-readable IP addresses.
Think of “www.google.com” as the name of a contact and “22.214.171.124”, the IP address, as the phone number. Google.com is human readable in the browser and the IP address is what machines and web servers can read.
What DNS is responsible for is generating a machine readable IP and using IP address proximity to determine the closest server to a user. This is common in cloud computing and content delivery networks (CDN).
This is a complex process. There is DNS hierarchy, Internet protocol (IP) and DNS lookups. We will explain all three areas in detail.
Domain Name System Hierarchy
The DNS hierarchy is the structure of domains within DNS. DNS hierarchy is as follows:
Root servers, or root level domains, provide access to the top level domains. This is a series of 13 servers with high bandwidth that organize DNS information for top level domains.
Top level domains
The top level domain is the highest domain level. This is your “.com”, “.org”, “.net”, “.edu”, “.gov”, etc. Top level domains now cover domain variations such as “.io”.
Second level domain
The second level domain (SLD) is the domain that follows the top level domain. If we use the example www.datapath.io, “.io” is the top level domain and “datapath” is the second level domain.
A network host is any device connected to a network or the Internet. All servers are hosts, but not all hosts are servers. This is the final layer in DNS Hierarchy.
This hierarchy is then assigned its information based upon Internet protocol (IP), which allows machines to communicate.
Internet protocol (IP) is how Internet communications work. IP is the underlying structure of DNS. It provides the machine readable information to serve websites to users. Both a website and a computer have an IP address and this is how information moves through the Internet.
IP handles location information to data packets, so packets are delivered to the correct places. Both sender and receiver have and IP address, which is the information that is associated with data packets.
With DNS, there is a process that ensure the human readable address becomes a machine readable address. Simultaneously the sender and the receiver both communicate their IP addresses.
This is DNS resolution.
The DNS Resolution Process
The DNS resolution process is how a web browser determines what website to serve and from where. We will walk through the DNS resolution process based upon no DNS caching. DNS caching is an entire conversation on its own.
The DNS resolution process is:
Step 1: Web browser recognizes a request
In the first step of the DNS resolution process, your web browser will recognize the request for a website. Our example will be www.datapath.io. This request is the human readable address in the web browser, which DNS will change to a machine readable address.
Step 2: Recursive DNS query requested
In our example, we have sent the initial request for the machine readable IP to the DNS resolver within the ISP. The requested DNS query receives the IP address that will now go to the root servers, the top level domain servers and the authoritative domain servers.
This is the IP associated with the requester.
Step 3: Request is sent to root servers
The next request is to the root servers. Root servers will provide all the information needed to retrieve requests from the top level domain servers.
The information that the root server provides is where the “.io” servers will be found. This sends the next request to the correct servers.
Step 4: Top level domain server receives a request
The request to the top level domain server is going to go to one of the 13 TLD servers around the world. The root server is what has specified which of these servers the request should make it to.
The IP from the first step will then communicate with one of these servers as a ping, same as the previous steps. This step then leads to a request to the authoritative servers.
Step 5: Authoritative servers receive a request
The next request makes it to the authoritative name server, which would be the www.datapath.io name server. This request will identify the IPs associated with www.datapath.io. This will determine the web server the initial request is directed to.
Step 6: DNS resolution
Once the initial IP has been determined and all three servers have made their request and response, the correct IP will be returned to the user requesting www.datapath.io. The IP returned will depend on the network prefix it is requested from. This will either be an IPv4 or IPv6 IP address.
Step 7: Web browser begins loading
Once the IP address has been returned to the user’s web browser, the web page will load. This process is time to load (TTL), which is determined in milliseconds. The speed of these communications will be affected by network latency.
DNS plays a fundamental role in how the Internet functions. It dictates where websites are requested, which can impact speed. Although DNS is a process that occurs in milliseconds, it affects the entire website loading process.
To learn more about networking terms, you can download our DevOps Networking Guide eBook.