Have you ever wondered what happens when you type google.com in the browser ?
On the surface it looks simple but behind the screen many things happen and one of them most important is DNS (Domain name server).Let's understand What is DNS, why we need it and how it works.
What is DNS?
Think DNS as phone book for internet.
when you tap on friends name on your phone, your phone already knows which phone number to call. Similar to that when you type google.com in browser DNS knows which IP address to connect.
- Website names are human readable
- IP address are machine readable As computer doesn't understand website name it needs IP address. So basically DNS is the Domain Name server which resolves the IP address for a website.
Why do we need DNS?
Domain name by itself does nothing.
DNS works with DNS records, which are set of instruction that tell internet important details about domain:
- who controls the domain
- where the website server is located
- whether domain is allowed to send emails
- where should the email delivered
Phone book comparison:
- User phone number
- nickname
- email address
- Home address
How DNS works?
Let's say you type google.com in browser
- DNS Query begins Your computer checks if IP address exists in your local cache
- DNS Resolver
if not found, it ask your DNS resolver, usually provided by your ISP Or public DNS resolver
- google 8.8.8.8
- cloudflare 8.8.8.8
- Root DNS DNS resolver contacts Root DNS server where to find the information TLD (.com) google.com -> .com is TLD (Top level domain). There are 13 root server globally maintain by ICAINN 4.TLD Server DNS resolver contacts the TLD (top level domain) find it authoritative DNS server
- Authoritative DNS This server provides the final IP address
- Website loads browser find the web server based on IP address and load the website
Types of DNS Records:
-
NS = Name Server
NS records tells who is responsible for your Domain's DNS
They connect your domain to DNS that manage all records
This of an apartment building, any query regarding the
building goes through the front desk. NS record act as front desk- A Points the domain to IPV4 address
- AAAA Same as A record but points the domain to IPV6 address
- MX (Mail exchange)
where the email for the domain should be delivered
- CNAME CNAME creates an alias i.e. one domain can point to another domain
Hope now you understand how the website is loaded in your browser.
Top comments (0)