DNS

Every machine that’s online has a unique IP address (2001:db8:0:1194:0:567:8:1).
DNS maps IP addresses to Domain names (www.example.com).

Components:

  • DNS Resolver (DNS Recursive Nameserver)
  • Root Nameserver
  • Top-Level Domain Nameserver
  • Domain Nameserver (Authoritative Nameserver)

DNS Resolution (DNS query lookup)

User enters domain name -> DNS Resolver -> Root Nameserver -> TLD Nameserver -> Domain Nameserver (Authoritative Nameserver) -> Domain IP address

Most of this DNS information is cached based on a TTL, usually a few hours.

DNS Load Balancing - Authoritative Nameserver

  • Domains have multiple servers in clusters spread out over various data centres.
  • Hence, the Authoritative Nameserver returns a list of IP addresses instead of a single address.
  • With every request, the authoritative server changes the order of the IP addresses in the list in a round-robin fashion.
  • The client forwards requests to the first address on the list.
  • If the first address does not return data within the TTL, it can make requests to the next address.