How DNS Works

Demystifying the phonebook of the internet.

What is DNS?

The Domain Name System (DNS) is essentially the phonebook of the Internet. Humans access information online through domain names, like google.com or devmetrix.cloud. Web browsers interact through Internet Protocol (IP) addresses. DNS translates domain names to IP addresses so browsers can load Internet resources.

Key Takeaway

Each device connected to the Internet has a unique IP address which other machines use to find the device. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.1.1 (in IPv4), or more complex newer alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in IPv6).

How Does DNS Work?

The process of DNS resolution involves converting a hostname (such as www.example.com) into a computer-friendly IP address (such as 192.168.1.1). An IP address is given to each device on the Internet, and that address is necessary to find the appropriate Internet device - like a street address is used to find a particular home.

The 4 Main DNS Servers

  • DNS Recursor: The recursor can be thought of as a librarian who is asked to go find a particular book somewhere in a library. The DNS recursor is a server designed to receive queries from client machines through applications such as web browsers.
  • Root Nameserver: The root server is the first step in translating (resolving) human readable host names into IP addresses. It can be thought of like an index in a library that points to different racks of books.
  • TLD Nameserver: The Top Level Domain server (TLD) can be thought of as a specific rack of books in a library. This nameserver is the next step in the search for a specific IP address, and it hosts the last portion of a hostname (In example.com, the TLD server is "com").
  • Authoritative Nameserver: This final nameserver can be thought of as a dictionary on a rack of books, in which a specific name can be translated into its definition. The authoritative nameserver is the last stop in the nameserver query.

The Steps in a DNS Lookup

  1. A user types example.com into a web browser and the query travels into the Internet and is received by a DNS Recursive Resolver.
  2. The resolver then queries a DNS Root Nameserver.
  3. The root server then responds to the resolver with the address of a Top Level Domain (TLD) DNS Server (such as .com or .net), which stores the information for its domains. When searching for example.com, our request is pointed toward the .com TLD.
  4. The resolver then makes a request to the .com TLD.
  5. The TLD server then responds with the IP address of the domain's nameserver, example.com.
  6. Lastly, the recursive resolver sends a query to the domain's nameserver.
  7. The IP address for example.com is then returned to the resolver from the nameserver.
  8. The DNS resolver then responds to the web browser with the IP address of the domain requested initially.
No previous sessionsMore coming soon...