How DNS Works (Domain Name System)?

How DNS Works (Domain Name System)?

The Domain Name System (DNS) translates human-readable domain names (like example.com) into IP addresses that computers use to communicate. It’s often described as the “phone book” or “directory” of the internet. 

At a high level, a DNS lookup involves your device asking a resolver to find the IP address for a domain, the resolver querying a hierarchy of DNS servers (root, TLD, authoritative), and then returning the answer, which is cached for performance.

How DNS Works (Domain Name System)?

DNS lookup process

  • Your application asks the OS to resolve a name; the stub resolver sends a query to the configured recursive resolver.
  • If the resolver doesn’t have a cached answer, it starts at the root.
  • Root servers return a referral to the appropriate TLD servers (e.g., .com).
  • The resolver queries the TLD servers, which return a referral to the domain’s authoritative servers.
  • The resolver queries the authoritative server, which replies with the record (e.g., an A or AAAA record).
  • The resolver returns the answer to your device and caches it per TTL.

DNS Record types 


Example (www.thenetworkdna.com)

  • Your browser asks the OS to resolve www.example.com.
  • The stub resolver sends a recursive query to 8.8.8.8 (example).
  • 8.8.8.8 queries a root server, which replies with .com TLD servers.
  • It queries a .com TLD server, which replies with NS records for www.thenetworkdna.com.
  • It queries the example.com authoritative server, which replies with an A record: X.X.X.X.
  • The resolver caches the response for its TTL and returns it to your device.