Domain Name Systems
Table of Contents
- Maps Domain Name -> IP Address
1 How DNS works:
When a request is made from the browser1, 2, 3:
- Browser checks its own cache
- Browser asks OS, OS checks its own cache
- OS asks Resolver (DNS recursive resolver):
- Domain Name Server in network setting
- Usually provided by ISP, or 1.1.1.1 or google's 8.8.8.8
- Resolver checks local cache, if not present contacts root nameserver
- root server returns Top Level Domain (TLD) DNS Server to the resolver
- TLD:
.com
,.org
- TLD:
- Resolver contacts TLD, TLD returns IP of domain's nameserver
- Example: nameserver of example.com
- Nameservers are also called as authoritative name server because they don't need to ask for IP to any other server
- Multiple nameservers for load balancing, fault tolerance
- Resolver contacts the Nameserver (NS), NS returns IP of example.com
- If query is for subdomain, then authoritative nameserver will give IP of additional authoritative nameserver
- Resolver returns IP to the OS, OS to the browser
- Browser contacts the website
1.1 Authoritative DNS vs Recursive DNS Resolver
- Recursive resolver is at the beginning of the DNS query
- Authoritative nameserver is at the end of the DNS query
1.2 In Short
->
contacts<-
returnsTable:
Requester Server Request Response User Browser goto example.com Browser OS IP of example.com OS Resolver IP of example.com Resolver root IP of .com IP of .com TLD Resolver .com TLD IP of example.com IP of NS of example.com Resolver NS IP of example.com IP of example.com OS Resolver IP of example.com Browser IP HTTP request 200 OK
2 TODO DNS Records4
Name | Details |
A | |
AAAA | |
CNAME | |
MS |