What is DNS. Why it is Importent.
As a internet user or a web developer it has been fine without knowing much about the DNS. You probably don’t care too mach about it. But let me say something really intresting, In year 2021 Oct Facebook experienced a DNS error which brought them a longest downtime it ever had in year 2008. Now You want might understood about DNS and why it’s so importent that it can bring down even the biggest online platforms
In this Blog ,I’ll answer the Following Questions:
What is DNS
How does DNS work
Why is DNS importent
Importent DNS Records to Know and what does they mean
How it DNS Resolution in happen
What is DNS?
DNS(domain name system) is one of the most important aspect of the internet and shaped how we know it as today. It is like phonebook for the interenet. It is the largest server located across the globe that contain a distributed database of domain names and IP address. It’s responsible for matching the right domain name with its corresponding IP address.
Domain Name
A domain name is the name of your website, for example, google.com It can either be purchased through a domain registrar or provided for free via a hosting provider. Domain names help make the internet easier to navigate as they are typically human-readable words and letters instead of long strings of numbers.
IP Address
An IP address is a unique group of numbers separated by full stops, which looks a little like this: 192.168.1.89. Each computer or server has its own IP address allowing them to communicate over the network. As machines are better at dealing with numbers, it just makes sense that they are identified that way. However, it can be difficult for us to remember a string of numbers every time we connect to the internet.
DNS Server
DNS Servers are computer servers specifically used to translate domain names to IP addresses, making it possible for DNS clients to reach the origin server.
DNS Hosting Service
A DNS hosting service is responsible for running DNS servers. They typically include domain name registrars who offer their hosting services with registration.
How Does DNS Work
The way DNS works are pretty straightforward. When you type a website's URL in your browser, It helps you connect the domain name with the right IP address. That process is called Domain Name Resolution.
ex. if you search google.com in browser → DNS resolution → 142.250.182.142
Why is DNS Important?
For many of us, connecting to internet is as easy as striking a few key on your keyboard or tapping on some letters an your smartphone. we can connect to endless amount of services within seconds. That’s all thanks to DNS
DNS ensures the internet is not only user-friendly but also works smoothly, loading whatever content we ask for quickly and efficiently. It's one of the cornerstones of how the internet operates. Without it, we'd be stuck memorizing long lists of numbers (IP addresses) to access the content we want. If a DNS cannot translate the domain name with the right IP address, you won't be able to access the website you're looking for.
let’s say you’ve memorized the IP addresses of the website or services.What would happen then if the owners of those IP addresses decide to change them? Suddenly the IP address you've memorized will no longer lead you to the content that you want.
DNS allows for those changes to happen without affecting how people find your service on the internet. "[If] they move to a new IP address. They can go and update those records and kind of transition services over," he detailed.
Importent DNS Records to Know and what does they mean
DNS records are essential components of the Domain Name System (DNS). They store information about a domain and help route internet traffic efficiently. Here's an overview of the most common types of DNS records you should know:
1. A Record (Address Record)
Purpose: Maps a domain name to an IPv4 address.
Example:
example.com
→ 192.0.2.1
2. AAAA Record (IPv6 Address Record)
Purpose: Maps a domain name to an IPv6 address.
Example:
example.com
→ 2001:db8::1
3. CNAME Record (Canonical Name Record)
Purpose: Points one domain name to another (aliasing).
Example:
www.example.com
→
example.com
4. MX Record (Mail Exchange Record)
Purpose: Specifies the mail server(s) responsible for receiving emails for the domain.
Example:
Copy
Copy
Priority 10: mail1.example.com Priority 20: mail2.example.com
5. TXT Record (Text Record)
Purpose: Stores text information for external verification (e.g., SPF, DKIM, DMARC, or custom notes).
Example:
Copy
Copy
"v=spf1 include:_spf.example.com ~all"
6. NS Record (Name Server Record)
Purpose: Specifies the authoritative DNS servers for the domain.
Example:
Copy
Copy
example.com → ns1.exampledns.com example.com → ns2.exampledns.com
7. SOA Record (Start of Authority Record)
Purpose: Provides administrative information about the domain, such as the primary name server, admin email, and timing parameters for DNS updates.
Example:
Copy
Copy
Primary NS: ns1.exampledns.com Admin Email: admin@example.com Refresh Time: 3600
8. PTR Record (Pointer Record)
Purpose: Maps an IP address to a domain name (reverse DNS lookup).
Example:
Copy
Copy
192.0.2.1 → example.com
9. SRV Record (Service Record)
Purpose: Specifies services like VoIP or instant messaging for a domain.
Example:
Copy
Copy
Service: _sip Protocol: _tcp Priority: 10 Weight: 5 Port: 5060 Target: sip.example.com
10. ALIAS or ANAME Record
Purpose: Similar to a CNAME but works at the root level of a domain, which CNAME cannot do.
Example:
Copy
Copy
example.com → someotherdomain.com
11. DNSSEC Records (DNS Security Extensions)
Purpose: Used to verify the authenticity and integrity of DNS data.
Common DNSSEC Record Types:
DS (Delegation Signer)
RRSIG (DNSSEC Signature)
DNSKEY (DNS Key)
NSEC (Next Secure Record)
12. SPF Record (Sender Policy Framework)
Purpose: Prevents email spoofing by specifying which mail servers can send emails on behalf of the domain.
Example:
Copy
Copy
"v=spf1 ip4:192.0.2.1 -all"
13. HINFO Record (Host Information Record)
Purpose: Describes the hardware and operating system of a host.
Example:
Copy
Copy
"CPU: Intel Xeon" "OS: Ubuntu Linux"
14. NAPTR Record (Naming Authority Pointer)
Purpose: Used for more complex redirection like SIP (Session Initiation Protocol) or ENUM services.
Example:
Copy
Copy
Order: 100 Preference: 10 Flags: "S" Service: "E2U+email" Regexp: "!^.*$!mailto:info@example.com!" Replacement: .
These DNS records provide the backbone for how the internet resolves names and routes traffic. Depending on your needs, some records (e.g., A, CNAME, MX, TXT) will be used frequently, while others (e.g., DNSSEC, NAPTR) are more specialized.
How it DNS Resolution in happen
Let’s break down the process of resolving the domain name google.com
to an IP address, step by step, explaining each layer involved in DNS resolution.
let’s say user will input google.com
your browser will check for the browser cache,if not found, it will proceeds to query the DNS resolver
The OS checks its own DNS cache for the IP address of google.com
if the IP is not cached ,the OS forwards the query to Recursive resolver ( usually provided by the ISP or a public DNS like googles 8.8.8.8)
Recursive Resolver
The recursive resolver is a DNS server that helps fetch the IP address for
google.com
by querying other DNS servers step-by-step:If the resolver has cached the IP address, it returns it to the browser.
Otherwise, it starts querying DNS servers in the following order
Root DNS Server
The resolver sends a query to a Root DNS Server (one of 13 globally distributed root server clusters).
Query Example: “Where can I find the DNS servers for
.com
domains?”The root server responds with the address of a TLD (Top-Level Domain) server responsible for
.com
domains.
TLD DNS Server
The resolver queries the TLD server for
.com
domains.Query Example: “Where can I find the authoritative DNS server for
google.com
?”The TLD server responds with the address of the authoritative DNS server for
google.com
.
Authoritative DNS Server
The resolver queries the authoritative DNS server for
google.com
.Query Example: “What is the IP address of
google.com
?”The authoritative DNS server responds with the IP address, e.g.,
142.250.190.14
.
Recursive Resolver Returns the IP
- The recursive resolver sends the IP address (
142.250.190.14
) back to your OS, which passes it to your browser.
- The recursive resolver sends the IP address (
Visualized Example
Browser Cache → Checked for
google.com
(miss).OS Cache → Checked for
google.com
(miss).Recursive Resolver → Begins DNS resolution.
Root Server → Returns
.com
TLD server.TLD Server → Returns
google.com
authoritative server.Authoritative Server → Returns
142.250.190.14
.Browser → Connects to
142.250.190.14
and loads the website.
In this way dns will resolve