I would recommend reading basic of DNS here. It Provides fundamental information about DNS.
What is DNS and why DNS resolution exist?
DNS can be considered the Phone book for internet
- It helps to find the IP address for a given domain
- Computer communicate using IP address, not domain name
DNS use cases:
- Human friendly names
- Decoupling between domain name and infrastructure
- Don't need to memorise IP address
Understand Inspect DNS:
dig is(Domain information Gropper) is the command that is used as DNS inspection tool
You can use it:
- Debug DNS issues
- understand all name server involved
- Inspect records(A,AAAA,MX,NS)
DNS does has multiple layer, each with its own responsibilities and each layer has enough information to query another layer
Root Servers -> TLD -> Authoritative server -> Actual IP address
Lets take some example to understand
1) dig . NS
- . stands for root server
- Root server provides information as who handles TLD (.com,.net)
- It doesn't have information about IP address
- It returns the list of root server names
2) dig com NS
- It ask who manages .com TLD
- It returns the list of TLD servers responsible for .com
3) dig google.com NS
It returns the Authoritative server name for google.com
4) dig google.com
It performs Full DNS resolution
- Check if google.com cached if yes, returns IP server
- if not cached ask the root server, what is TLD for google.com
- Ask TLD, which name server handles google.com
- Ask authoritative server for the IP address of google.com
- Cache the IP address based on TTL
In short, your browser does not directly communicate with root or TLD server. Instead your recursive DNS resolver perform the steps.
Top comments (0)