DNS Quick Notes
dnsI was studying for my AWS Solutions Architect exam and realized that I was pretty weak on some web concepts. I’ve been mostly working on internal automation/ETL tools and some enterprise web, so I haven’t had the chance to deal with large-scale web traffic. After reading a bit of RFC 1034, various articles, and tinkering with dig, I think I’ve gotten a hand of how DNS works.
The gist of, say, looking up google.com
, is this:
- Ask your router at
192.168.1.1
for.
. - Router gives you (likely cached)
NS
records for.
(root servers). - Ask one of the root servers for the TLD
com
. - Root server gives you
NS
records for generic top-level domain (GLTD) servers forcom
. - Ask one of the gltd servers for subdomain
google.com
. - gltd server gives you NS records for the subdomain
google.com
. - Ask one of the NS servers for
google.com
. - NS server can either give you a
CNAME
record that points to the canonical name (i.e. the subdomain that actually maps to the IP address of the resource you’re looking for), or anA
(orAAAA
for ipv6) record that maps that maps thegoogle.com
subdomain to the IP address of the server holding the resource forgoogle.com
. In the case ofgoogle.com
, though, it’s just anA
record, not aCNAME
.
All of this is handled by the DNS resolver on each nameserver after your client makes the query.