Domain name system

  • Sprouting
  • c.

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

What is DNS?

When a browser requests a website such as https://www.example.com , it needs to find the Internet protocol (IP) address of the server that hosts that site in order to establish a connection and load resources. It does this using the domain name system (DNS).

Servers

A DNS lookup requires 4 servers to locate the IP address of the requested domain name:

  1. Recursive resolver: takes the client request and recursively makes additional requests on the client’s behalf.
  2. Root nameserver: points the resolver to the correct TLD nameserver.
  3. TLD nameserver: points the resolver to the authoritative nameserver for the hostname.
  4. Authoritative nameserver: returns the IP address of the target server to the resolver.
flowchart LR
    id1[client
    request]
    subgraph DNS
        id2[recursive
        resolver]
        id3[root
        nameserver]
        id4[TLD
        nameserver]
        id5[authoritative
        nameserver]
    end
    id1 --> id2
    id2 --> id3
    id3 --> id4
    id4 --> id5

Example

Using the dig command-line tool, we can trace a DNS query to example.com.

Terminal window
$ dig example.com +trace
. 193735 IN NS m.root-servers.net.
com. 172800 IN NS j.gtld-servers.net.
example.com. 172800 IN NS elliott.ns.cloudflare.com.
example.com. 277 IN A 172.66.147.243
example.com. 277 IN A 104.20.23.154