Domain Name System

DNS Resolution Flow

  1. Open browser and search www.xxx.com
  2. Check Browser Cache (RAM in browser) whether already knows IP for this domain.
  3. If no, check OS DNS Cache
  4. If no, check Recursive Resolver (a type of DNS Resolver), the “middleman”
    1. DNS Resolver will go through Root, TLD, Authoritative servers until get final answer.
Name What it is Example Notes
ISP Resolver Resolver provided by your Internet Service Provider Maxis, TIME, Celcom Usually default, works fine, caches some domains
Public Resolver Resolver anyone can use Google 8.8.8.8, Cloudflare 1.1.1.1 Often faster, more privacy options, global coverage
  1. Root Name Server
  2. TLD Name Server (.com)
  3. Authoritative Name Server
  4. Cache the domain and ip.
[Your Computer]
        |
        | asks “IP of www.google.com”
        v
[Recursive Resolver (ISP / Public DNS)]
        |
        | checks cache, if missing:
        v
[Root Name Server] → [.com TLD Server] → [Authoritative Google DNS]
        |
        v
[IP Address returned to Resolver]
        |
        v
[Resolver caches IP, sends it to your Computer]
        |
        v
[Browser connects to the IP]

Common DNS types

Record Type Purpose / Use Case Example Notes
A Maps domain to IPv4 address example.com → 93.184.216.34 Most basic record; required for web access
AAAA Maps domain to IPv6 address example.com → 2606:2800:220:1:248:1893:25c8:1946 IPv6 version of A record
CNAME Alias to another domain www.example.comexample.com Cannot point directly to IP; resolves to A/AAAA
MX Mail server for domain example.commail.google.com Supports priority (lower = higher priority)
TXT Arbitrary text, verification, security v=spf1 include:_spf.google.com ~all Used for SPF, DKIM, domain ownership verification
NS Name servers for a domain example.comns1.cloudflare.com Shows who manages DNS for this domain
PTR Reverse DNS: IP → domain 93.184.216.34 → example.com Mainly used in email validation, reverse lookup
SRV Service location (protocol/port) _sip._tcp.example.com →
10 60 5060 sipserver.example.com Used for VoIP, Minecraft servers, etc.
SOA Start of Authority ns1.example.com, [email protected] Contains admin info, serial number, refresh time; mandatory for every zone