
How does a browser know where a website lives?
When I type a website like example.com,
my browser somehow finds the correct server.
But computer does not understand names.
Computer understands numbers (IP addresses).
So question is:
How name becomes number?
Answer is DNS.
What is DNS
DNS (Domain Name System) is like phonebook of the internet.
You remember name → “Google”
Phonebook gives number → “123…”
Same way:
Browser has domain name
DNS gives IP address
So browser knows where to go.
Why DNS records are needed
DNS records are instructions stored in DNS.
They tell:
where website is hosted
where email should go
who controls the domain
extra verification info
Without DNS records:
website won’t open
emails won’t work
High-level DNS flow
Browser
↓
DNS Server
↓
IP Address
↓
Website Server
What is an NS Record
NS (Name Server) record tells:
who is responsible for this domain
It is like:
- “Which office handles this address?”
Example:
example.com → ns1.host.com
example.com → ns2.host.com
NS records point to DNS provider.
Without NS record, no DNS works at all.
What is an A Record
A record maps:
domain name → IPv4 address
Example:
example.com → 93.184.216.34
Think like:
- House name → house number
This is most common DNS record.
What is an AAAA Record
AAAA record is same as A record,
but for IPv6 address.
Example:
example.com → 2001:db8::1
Simple:
A = IPv4
AAAA = IPv6
What is a CNAME Record
CNAME means:
one name points to another name
Example:
www.example.com → example.com
So:
browser asks for
www.example.comDNS says “go to example.com”
Diagram
www.example.com
↓
example.com
↓
IP address
Common confusion: A vs CNAME
A record points to IP
CNAME points to another domain name
Rule:
Root domain → usually A record
Subdomain → often CNAME
What is an MX Record
MX (Mail Exchange) record is for emails.
It tells:
where emails should be delivered
Example:
example.com → mail.google.com
If MX record is wrong:
- emails will not arrive
Email flow using MX record
Email sender
↓
DNS (MX record)
↓
Mail server
What is a TXT Record
TXT record stores extra information.
Used for:
domain verification
email security (SPF, DKIM)
ownership proof
Example:
"google-site-verification=xyz"
Humans rarely read TXT records,
machines use them.
NS vs MX
NS → who controls DNS
MX → who handles email
Different jobs, different records.
How all DNS records work together
One website usually uses many records.
Example setup:
NS → DNS provider
A → Website IP
CNAME → www → main domain
MX → Email server
TXT → Verification / security
All together, website and email work properly.
One complete DNS setup
example.com
├── NS → DNS provider
├── A → Web server IP
├── CNAME → www.example.com
├── MX → Mail server
└── TXT → Verification
Short Summary
DNS is the phonebook of the internet
It converts domain names into IP addresses
DNS records give instructions to internet
NS decides who controls the domain
A / AAAA map domain to IP
CNAME points one name to another
MX handles emails
TXT stores extra verification data
About the author
I’m learning web development and sharing what I understand to help other beginners.
Comments
Join the discussionNo comments yet. Be the first to comment.



