Skip to main content

DNS Resolution

Published 3 min readMarkdown
DNS Resolution

What is DNS resolution ?

(DNS = Phone book of internet)
The Problem is computer do not understand the names like

nitishkumar.cloud
cahicode.com

Computers only understand Ip address

Then DNS comes to picture

imagine you have to remember phone number of all your friend it is pain !na
DNS came to picture and simpified like remembering all phone number now you have to only
friends name

analogy:

Real LifeInternet
Name: Nitish kuarDomain: nitishkumar.cloud
Phone numberIP address:192.168.137.1
Contacts appDNS

What is DIG and When it used ?

DIG stands for Domain information Groper

It is command used to :

  1. Debug the DNS

  2. To see which server is responding

  3. To understand full rsolution path

  4. To check records A , MX , TXT ,etc

Why engineers use dig:

  • Website not opening

  • DNS misconfigured

  • Checking propagation

  • Cloud / DevOps debugging

  • Security analysis

Example:

dig nitishkumar.cloud

This shows:

  • Which server answered

  • What IP you got

  • How long it took

  • DNS flags


DNS Hierarchy

DNS woks in layer

Root (.)
   ↓
TLD (.com, .org, .in)
   ↓
Authoritative (google.com servers)

dns_hierarchy


dig . NS → Root Name Servers

Root = Top boss

dig . NS

This asks:
Who controls the ROOT of DNS?

Output gives:

These are root name servers.

What they do:

They do not know google.com
for .com it go to .com TLD servers

Real-life analogy:

Root = Country-level office
They don’t know your house, they only know:
Ask the Karnataka office


dig com NS → TLD Name Servers

TLD = .com managers

dig com NS

This asks:
Who manages .com domains?

They reply with:

What they do:

They Told
For google.com, go talk to Google’s name servers


dig google.com NS → Authoritative Servers

Authoritative = Final Truth Source

dig google.com NS

This gives:

These are Google’s own DNS servers.

What they do:

They store:

  • A records (IP)

  • MX (mail)

  • TXT (verification)

  • CNAME etc.

They are the final source of truth for google.com.


dig google.com → Full Resolution Result

This is what browser want

dig google.com

That gives:

google.com.   A   142.250.xxx.xxx

This is the actual IP your browser connects to.

(Cheat Sheet)

CommandDNS Layer
dig . NSRoot
dig com NSTLD
dig google.com NSAuthoritative
dig google.comFinal IP
Browser requestUses IP

credits:

https://www.geeksforgeeks.org/computer-networks/domain-name-system-dns-in-application-layer/

https://www.ibm.com/think/topics/dns

No comments yet. Be the first to comment.