DNS Resource Record
A resource record (RR) is a single entry in a DNS zone that provides information about a domain
name. Each RR has:
• Name: The domain or subdomain (e.g., www.mycorp.com).
• Type: The record type (e.g., A, MX, CNAME).
• Value: The data (e.g., an IP address, another domain name).
• TTL (Time to Live): How long the record is cached by resolvers (e.g., 3600 seconds).
A zone file is essentially a list of these records, managed by the authoritative name server. The
listed record types (A, AAAA, CNAME, MX, NS, PTR, SOA, SRV, TXT) serve different purposes,
from mapping domains to IPs to specifying mail servers or service locations.
1. A (Address) Record
Purpose: Maps a domain name to an IPv4 address.
Think of it like: Telling people your shop’s physical location (IPv4).
Example: mycorp.com A 192.168.1.10
Means: When someone goes to mycorp.com, send them to the server at 192.168.1.10.
2. AAAA (IPv6 Address) Record
Purpose: Maps a domain to an IPv6 address (newer version of IP).
Think of it like: Your building got a new digital address in a new city system (IPv6).
Example: mycorp.com AAAA 2001:0db8:85a3::8a2e:0370:7334
Means: When someone goes to mycorp.com, route them using this IPv6 address.
3. CNAME (Canonical Name) Record
Purpose: Points one domain name to another domain name.
Think of it like: A nickname or shortcut. “Call the manager” = “Talk to Mr. Smith”.
Example: www.mycorp.com CNAME mycorp.com
Means: When someone visits www.mycorp.com, treat it as mycorp.com.
4. MX (Mail Exchange) Record
Purpose: Tells where to send emails for the domain.
Think of it like: The mailroom address for your company.
Example: mycorp.com MX 10 mail.mycorp.com
Means: All emails to @mycorp.com should be sent to the mail server at mail.mycorp.com.
The number 10 is priority (lower is higher priority).
5. NS (Name Server) Record
Purpose: Defines which DNS servers are authoritative for a zone.
Think of it like: Saying “Ask these people for anything about my company.”
Example:
mycorp.com NS ns1.mycorp.com
mycorp.com NS ns2.mycorp.com
Means: These two servers have the official DNS info for mycorp.com.
6. PTR (Pointer) Record
Purpose: Used in reverse DNS lookups — converts IP to hostname.
Think of it like: Looking at a phone number and asking “Whose number is this?”
Example: 10.1.2.3.in-addr.arpa PTR mail.mycorp.com
Means: If someone looks up 3.2.1.10, they’ll find mail.mycorp.com.
7. SOA (Start of Authority) Record
Purpose: Every zone must have one. It gives:
• Who’s responsible for the zone
• When it was last updated
• How often others should check for changes
Think of it like: The cover page of the DNS folder — who owns it, version number, etc.
Example: mycorp.com SOA ns1.mycorp.com admin.mycorp.com 2025041601 ...
Means: ns1 is the primary server, contact person is [email protected], and this version
was updated today.
8. SRV (Service Locator) Record
Purpose: Points to servers that provide specific services, like Microsoft Teams, Skype, LDAP,
etc.
Think of it like: A concierge telling you which room hosts the meeting.
Example: _ldap._tcp.mycorp.com SRV 0 5 389 server1.mycorp.com
Means: For LDAP over TCP, go to port 389 on server1.mycorp.com.
9. TXT (Text) Record
What it does: Stores arbitrary text data associated with a domain.
Purpose: Used for verification, SPF (email security), DKIM, DMARC, or custom metadata.
Format: domain TTL IN TXT "text-string"
Mycorp uses SPF to prevent email spoofing, specifying which servers can send @mycorp.com
emails.
Record: mycorp.com. 3600 IN TXT "v=spf1 mx include:_spf.google.com ~all"
Explanation: This SPF record says:
• v=spf1: SPF version 1.
• mx: Allow Mycorp’s MX servers (e.g., mail.mycorp.com).
• include:_spf.google.com: Allow Google’s mail servers (if using Google Workspace).
• ~all: Soft fail for other servers (mark as suspicious).
How it works:
• An email server receives a message from [email protected].
• It checks mycorp.com’s TXT record to verify the sender’s IP is authorized.
Summary:
Record Purpose Real-Life Analogy
A IPv4 Address Street address
AAAA IPv6 Address New digital address
CNAME Alias for another name Nickname
MX Email routing Mailroom
NS DNS authority Point of contact
PTR IP to hostname Reverse lookup
SOA Zone metadata Cover page of a document
SRV Service location Service directory
TXT Notes or policies Sticky note for verifications
DNS Lookup Process
Scenario:
You (the client) want to visit www.whitehouse.gov — but your computer doesn't know the IP
address. So, it asks around step by step, like a detective asking people in a city for directions.
Step-by-Step DNS Lookup (Like asking for directions):
Step 1: Ask your nearest helper
→
You (the computer) ask your local DNS server (usually from your ISP or internal DNS) —
“Hey, where is www.whitehouse.gov?”
Step 2: Local helper says: “Let me ask the main directory”
→
Your local DNS server doesn’t know the answer, so it goes to the Root DNS Server, which is like
the main office of the global internet.
“Hey root server, I’m looking for www.whitehouse.gov. Can you help?”
Step 3: Root server says: “Ask the .gov building”
→
The Root DNS server replies:
“I don’t know the full address, but I know the people (NS) in charge of .gov domains. Go ask
them!”
It gives the IP address of the .gov DNS server.
Step 4: Local DNS asks .gov server
→
Your local DNS server now asks the .gov DNS server:
“Hey .gov team, where can I find www.whitehouse.gov?”
Step 5: .gov server says: “Ask the whitehouse.gov office”
→
The .gov server replies:
“I don’t know exactly, but the whitehouse.gov name servers do. Here’s how to contact them.”
It gives the authoritative name server info for whitehouse.gov.
Step 6: Local DNS asks whitehouse.gov name server
→
Your local DNS server now asks the whitehouse.gov name server directly:
“Hi, I need the IP address for www.whitehouse.gov. Can you help?”
Step 7: Whitehouse.gov server gives the final answer
→
The authoritative server says:
“Yes, www.whitehouse.gov lives at IP address 23.45.67.89.”
This is the A record (IPv4 address).
Step 8: Local DNS gives you the final answer
→
Finally, your DNS server comes back to you (the client) and says:
“I found it! www.whitehouse.gov = 23.45.67.89. Go ahead and visit!”
Now your browser uses this IP address to visit the website.
Visual Summary (in simple terms):
Step Who talks to whom? What's being asked
1 Client → Local DNS Where is www.whitehouse.gov?
2 Local DNS → Root DNS Help me find it
3 Root DNS → Local DNS Ask .gov DNS
4 Local DNS → .gov DNS Help me find whitehouse.gov
5 .gov DNS → Local DNS Ask whitehouse.gov DNS
6 Local DNS → whitehouse.gov DNS What's the IP for www.whitehouse.gov?
7 whitehouse.gov DNS → Local DNS Here's the IP address
8 Local DNS → Client Here’s the final answer!
─── ⋆⋅☆⋅⋆ ───