Current Affairs updated daily
KalviGavaniKalviGavani
Class 12 · Tamil Nadu State Board

DNS Exercise Solutions | KalviGavani

Samacheer Kalvi Class 12 Computer Applications Chapter 12 DNS exercise solutions — Domain Name System, DNS hierarchy (root, TLD, authoritative), DNS resolution process, DNS records (A, MX, CNAME, NS, AAAA, PTR), recursive and authoritative servers, DNS caching with detailed explanations.

Updated 13 June 202620 min read

Chapter 12 — DNS: Exercise Solutions Guide

How to Use This Page

1. Attempt every exercise on your own before reading the solutions. 2. Compare your method with the answer shown — focus on the concept, not just memorising terms. 3. Draw the DNS hierarchy and resolution flow diagrams by hand — they frequently appear in exams.


Key Concepts (Quick Recap)

  • DNS (Domain Name System) is a hierarchical, distributed naming system that translates domain names to IP addresses.
  • Domain name — human-readable address like www.example.com; easier to remember than 93.184.216.34.
  • DNS hierarchy — Root servers (top) → TLD servers (.com, .org, .in) → Authoritative servers (example.com).
  • Root servers — 13 logical root server clusters worldwide; they know the addresses of all TLD servers.
  • TLD (Top-Level Domain) — the last part of a domain name: .com, .org, .net, .in, .edu, .gov.
  • Authoritative DNS server — holds the actual DNS records for a domain and provides definitive answers.
  • Recursive (resolving) DNS server — queries other servers on behalf of the client to resolve a domain.
  • DNS resolution — the process of converting a domain name to an IP address through iterative queries.
  • DNS records — A (IPv4), AAAA (IPv6), MX (mail), CNAME (alias), NS (name server), PTR (reverse), SOA, TXT.
  • DNS caching — browsers, OS, and DNS servers cache results to speed up future lookups.
  • Reverse DNS — maps an IP address back to a domain name using PTR records.
  • Domain name structure — subdomain.second-level-domain.top-level-domain (e.g., www.example.com).

I. Choose the Best Answer (MCQs)

1. What is the primary function of DNS?
Answer

(a) Encrypt data    (b) Translate domain names to IP addresses    (c) Route emails    (d) Block malware

Answer(b) Translate domain names to IP addresses

Explanation: DNS acts like a phonebook of the Internet — it resolves human-readable domain names (www.google.com) into machine-readable IP addresses (142.250.190.4).


2. Which DNS record maps a domain name to an IPv4 address?
Answer

(a) MX    (b) CNAME    (c) A    (d) NS

Answer(c) A

Explanation: An A record maps a domain name to an IPv4 address. For IPv6, the AAAA record is used.


3. How many root server clusters exist in the DNS hierarchy?
Answer

(a) 1    (b) 7    (c) 13    (d) 256

Answer(c) 13

Explanation: There are 13 logical root server clusters (named A through M), each with multiple physical servers distributed worldwide using Anycast routing.


4. What does a CNAME record do?
Answer

(a) Maps a domain to an IP address    (b) Creates an alias from one domain to another    (c) Specifies a mail server    (d) Points to a name server

Answer(b) Creates an alias from one domain to another

Explanation: A CNAME (Canonical Name) record maps one domain name to another. For example, blog.example.com could be a CNAME pointing to example.wordpress.com.


5. Which DNS record is used to specify the mail server for a domain?
Answer

(a) A    (b) MX    (c) CNAME    (d) PTR

Answer(b) MX

Explanation: The MX (Mail Exchange) record specifies the mail server responsible for receiving emails for a domain. It includes a priority value for multiple servers.


6. What is a recursive DNS server?
Answer

(a) A server that stores the original DNS records    (b) A server that queries other servers on behalf of the client    (c) A server that only caches results    (d) A server at the root level

Answer(b) A server that queries other servers on behalf of the client

Explanation: A recursive (resolving) server accepts a client's query and follows the chain (root → TLD → authoritative) to find the answer, then returns it to the client.


7. In the domain name www.example.com, what is the TLD?
Answer

(a) www    (b) example    (c) com    (d) www.example

Answer(c) com

Explanation: TLD (Top-Level Domain) is the rightmost part of the domain name. Here, .com is the TLD, example is the second-level domain, and www is the subdomain.


8. Which DNS record is used for reverse DNS lookups?
Answer

(a) A    (b) MX    (c) CNAME    (d) PTR

Answer(d) PTR

Explanation: A PTR (Pointer) record maps an IP address back to a domain name (reverse of an A record). It is used in reverse DNS lookups.


9. DNS caching occurs at which levels?
Answer

(a) Browser only    (b) Operating system only    (c) Browser, OS, and DNS servers    (d) Authoritative servers only

Answer(c) Browser, OS, and DNS servers

Explanation: DNS results are cached at multiple levels: browser cache, OS cache (DNS Client service), and DNS server cache. This reduces lookups and speeds up resolution.


10. What is the purpose of the NS record?
Answer

(a) Maps domain to IP    (b) Specifies the authoritative name servers for a domain    (c) Redirects one domain to another    (d) Stores email settings

Answer(b) Specifies the authoritative name servers for a domain

Explanation: The NS (Name Server) record indicates which DNS servers are authoritative for a domain. It tells resolvers where to find the domain's records.


II. Fill in the Blanks

1. DNS stands for Domain Name System.

2. The DNS hierarchy has three levels: Root servers, TLD servers, and Authoritative servers.

3. A root server is the starting point of DNS resolution and knows the addresses of all TLD servers.

4. The A record maps a domain name to an IPv4 address.

5. The AAAA record maps a domain name to an IPv6 address.

6. The MX record specifies the mail server for a domain.

7. A CNAME record creates an alias from one domain name to another domain name.

8. PTR records are used for reverse DNS lookups (IP to domain name).

9. A recursive DNS server queries other servers on behalf of the client to resolve a domain.

10. The rightmost part of a domain name (e.g., .com, .org) is called the Top-Level Domain (TLD).


III. True or False

1. DNS translates IP addresses to domain names by default. — False. DNS primarily translates domain names to IP addresses (forward lookup). Reverse DNS (PTR records) does the opposite.

2. There are 13 root server clusters in the DNS hierarchy. — True. There are 13 logical root server clusters (A through M), though each cluster has many physical servers worldwide.

3. An authoritative DNS server queries other servers to resolve a domain. — False. An authoritative server holds the actual records and provides definitive answers. It is a recursive server that queries other servers.

4. A CNAME record can point to another CNAME record. — True. Though it is not recommended (it creates chains), a CNAME can point to another CNAME. However, a CNAME must not be used for the root domain.

5. DNS caching speeds up subsequent lookups. — True. Caching stores previously resolved domain names at the browser, OS, and DNS server levels, avoiding repeated queries.

6. The MX record has a priority value to determine the order of mail servers. — True. Lower priority values indicate higher preference. For example, MX 10 mail1.example.com is preferred over MX 20 mail2.example.com.

7. A recursive DNS server holds the original DNS records for a domain. — False. An authoritative server holds the original records. A recursive server only caches the results it finds through queries.

8. The domain name www.example.com has three levels: root, TLD, and second-level domain. — True. In the full name: . (root) → com (TLD) → example (second-level domain). "www" is a subdomain (hostname).

9. DNS uses the UDP protocol on port 53 for queries. — True. DNS primarily uses UDP port 53 for queries. It falls back to TCP for responses larger than 512 bytes or for zone transfers.

10. The SOA record specifies the start of authority for a DNS zone. — True. The SOA (Start of Authority) record contains administrative information about the zone, including the primary name server, email of the admin, and refresh intervals.


IV. Match the Following

Set A

No.Column ANo.Column B
1A recorddDomain → IPv4 address
2AAAA recordeDomain → IPv6 address
3MX recordaDomain → Mail server
4CNAME recordcDomain → Domain alias
5NS recordbDomain → Authoritative name server

Set B

No.Column ANo.Column B
1Root serverdStarting point of DNS resolution
2TLD servereManages .com, .org, .in, etc.
3Authoritative serveraHolds actual DNS records for a domain
4Recursive servercQueries other servers on behalf of client
5PTR recordbIP address → Domain name

V. Short Answer Questions

1. What is DNS? Why is it needed?
Answer

DNS (Domain Name System) is a hierarchical, distributed naming system that translates domain names (like www.google.com) into IP addresses (like 142.250.190.4).

Why DNS is needed:

  • Humans remember names (www.example.com) easily, but computers use IP addresses (192.168.1.1).
  • Without DNS, users would have to type IP addresses for every website.
  • DNS automates this translation, making the Internet user-friendly.
  • DNS is like a phonebook: you look up a name to get the number.

2. Explain the DNS hierarchy.
Answer

DNS uses a hierarchical tree structure with three main levels:

1. Root Level (Top):
Answer
  • Represented by a dot (.) — usually omitted in URLs.
  • 13 root server clusters (A through M) worldwide.
  • Root servers know the addresses of all TLD servers.
2. TLD Level (Top-Level Domain):
Answer
  • Manages domain names within a specific TLD (.com, .org, .in, .edu).
  • TLD servers know the addresses of authoritative servers for each domain under them.
3. Authoritative Level (Second-Level Domain):
Answer
  • Manages records for a specific domain (e.g., example.com).
  • Contains A, MX, CNAME, NS, and other records.
  • Provides definitive answers for queries about its domain.

Example hierarchy: . (root) → .com (TLD) → example.com (authoritative) → www.example.com (subdomain/record)


3. Differentiate between recursive and authoritative DNS servers.
Answer
FeatureRecursive ServerAuthoritative Server
RoleResolves queries for clientsHolds official DNS records
Data sourceQueries other serversStores its own zone data
CachingCaches results for future useDoes not cache; provides definitive answers
Response type"Here's the answer I found""Here's the authoritative answer"
ExampleISP's DNS server, Google DNS (8.8.8.8)ns1.example.com (domain's name server)
Work doneDoes the lookup workResponds to queries about its domain

4. List and explain common DNS record types.
Answer
RecordFull NamePurposeExample
AAddressMaps domain to IPv4example.com → 93.184.216.34
AAAAIPv6 AddressMaps domain to IPv6example.com → 2606:2800:220:1:...
MXMail ExchangeSpecifies mail serverexample.com → mail.example.com (priority 10)
CNAMECanonical NameCreates domain aliasblog.example.com → example.wordpress.com
NSName ServerSpecifies authoritative DNS serversexample.com → ns1.example.com
PTRPointerMaps IP to domain (reverse DNS)34.216.184.93 → example.com
SOAStart of AuthorityZone admin info, serial, refreshContains primary NS, admin email, TTL
TXTTextStores arbitrary text (SPF, DKIM)"v=spf1 include:_spf.google.com ~all"

5. What is DNS caching? Where does it occur?
Answer

DNS caching is the process of storing previously resolved DNS queries locally so that future requests for the same domain can be answered faster without re-querying.

Caching occurs at multiple levels:

1. Browser cache — Modern browsers cache DNS results with a TTL (Time to Live). 2. Operating system cache — The OS DNS client (e.g., Windows DNS Client service) caches results. 3. Recursive DNS server cache — The ISP's or public DNS server caches results until TTL expires. 4. Router cache — Home/office routers may cache DNS responses.

TTL (Time to Live):

  • Each DNS record has a TTL value (in seconds).
  • When the TTL expires, the cached entry is discarded and a fresh lookup is performed.
  • Typical TTL values: 300 seconds (5 min) to 86400 seconds (24 hours).

Benefits: Faster resolution, reduced DNS traffic, lower load on DNS servers.


6. Explain the structure of a domain name with an example.
Answer

A domain name is read from right to left, with each level separated by a dot.

Example: www.example.com

PartLevelDescription
. (implicit)RootThe root of the DNS tree
comTLD (Top-Level Domain)Indicates the type (.com, .org, .in)
exampleSecond-Level DomainThe registered domain name
wwwSubdomain/HostnameA specific host within the domain

Other examples:

  • mail.google.com — subdomain: mail, SLD: google, TLD: com
  • cs.annauniv.edu.in — subdomain: cs, SLD: annauniv, TLD: edu, ccTLD: in

Fully Qualified Domain Name (FQDN): www.example.com. (note the trailing dot representing the root).


VI. Detailed Answer Questions

1. Explain the DNS resolution process step by step.
Answer

When a user types a URL like www.example.com in a browser, the following steps occur:

Step 1 — Browser Cache: The browser checks its own DNS cache. If the domain's IP is found and not expired, it uses it directly.

Step 2 — OS Cache: If not found in the browser, the OS DNS resolver checks its local cache (e.g., Windows DNS Client service).

Step 3 — Recursive DNS Server: If not cached locally, the OS sends a query to the configured recursive DNS server (usually the ISP's or a public DNS like 8.8.8.8). The recursive server checks its cache.

Step 4 — Root Server: If the recursive server doesn't have the answer, it queries a root server: "What is the IP of www.example.com?" The root server responds: "I don't know, but here are the .com TLD servers."

Step 5 — TLD Server: The recursive server queries a .com TLD server: "What is the IP of www.example.com?" The TLD server responds: "I don't know, but here are the authoritative servers for example.com."

Step 6 — Authoritative Server: The recursive server queries example.com's authoritative server: "What is the IP of www.example.com?" The authoritative server responds with the A record: "www.example.com = 93.184.216.34."

Step 7 — Response and Caching: The recursive server returns the IP to the client and caches the result (based on TTL). The browser and OS also cache it. The browser then connects to the IP address to load the website.

Summary flow: Client → Browser Cache → OS Cache → Recursive Server → Root Server → TLD Server → Authoritative Server → Response back to client.


2. Explain the DNS hierarchy with a diagram description and examples.
Answer

The DNS hierarchy is an inverted tree structure with the root at the top:

. (Root) / | \ .com .org .in (TLD Servers) / \ | | example google wikip nic (Authoritative Servers) / \ www mail (Subdomains/Hosts)

Level 1 — Root (.)

  • The top of the hierarchy, represented by a trailing dot.
  • 13 root server clusters worldwide.
  • Knows the addresses of all TLD servers.

Level 2 — Top-Level Domain (.com, .org, .in, .edu)

  • Manages domains under a specific TLD.
  • Two types: Generic TLDs (gTLDs) — .com, .org, .net; Country-code TLDs (ccTLDs) — .in, .uk, .jp.

Level 3 — Second-Level Domain (example, google)

  • The registered domain name (example.com).
  • Managed by the domain's authoritative name servers.
  • Contains all DNS records for the domain.

Level 4 — Subdomain/Host (www, mail, blog)

  • Specific hosts or services under the domain.
  • www.example.com, mail.example.com, blog.example.com.

Example resolution path for www.example.com: 1. Root server: "Go to .com TLD server." 2. .com TLD server: "Go to example.com's authoritative server." 3. Authoritative server: "www.example.com = 93.184.216.34."


3. Explain all DNS record types with examples and their uses.
1. A Record (Address Record):
Answer
  • Maps a domain name to an IPv4 address.
  • Most common and essential DNS record.
  • Example: example.com. IN A 93.184.216.34
  • Use: When you type example.com, the A record tells the browser the IP address.
2. AAAA Record (IPv6 Address Record):
Answer
  • Maps a domain name to an IPv6 address.
  • "Quad-A" because IPv6 addresses are four times longer.
  • Example: example.com. IN AAAA 2606:2800:220:1:248:1893:25c8:1946
  • Use: Directs traffic to IPv6-enabled servers.
3. MX Record (Mail Exchange Record):
Answer
  • Specifies the mail server responsible for receiving emails for a domain.
  • Includes a priority value (lower = higher priority).
  • Example:
example.com. IN MX 10 mail1.example.com. example.com. IN MX 20 mail2.example.com.
  • Use: When someone sends an email to [email protected], the MX record tells the sender which server to deliver it to.
4. CNAME Record (Canonical Name Record):
Answer
  • Creates an alias from one domain name to another.
  • The alias points to the canonical (real) domain name.
  • Example: blog.example.com. IN CNAME example.wordpress.com.
  • Use: When you want blog.example.com to show the same content as example.wordpress.com without a separate A record.
5. NS Record (Name Server Record):
Answer
  • Specifies the authoritative DNS servers for a domain.
  • Example: example.com. IN NS ns1.example.com.
  • Use: Tells resolvers which servers hold the official DNS records for the domain.
6. PTR Record (Pointer Record):
Answer
  • Maps an IP address back to a domain name (reverse DNS).
  • Example: 34.216.184.93.in-addr.arpa. IN PTR example.com.
  • Use: Used in reverse DNS lookups; important for email server verification.
7. SOA Record (Start of Authority Record):
Answer
  • Contains administrative information about a DNS zone.
  • Fields: primary NS, admin email, serial number, refresh, retry, expire, minimum TTL.
  • Example: example.com. IN SOA ns1.example.com. admin.example.com. 2024010101 3600 900 604800 86400
  • Use: Defines the zone's properties and sync between primary and secondary name servers.
8. TXT Record (Text Record):
Answer
  • Stores arbitrary text data; commonly used for verification and security.
  • Example: example.com. IN TXT "v=spf1 include:_spf.google.com ~all"
  • Use: SPF records (email validation), domain ownership verification, DKIM, and DMARC.

4. Compare forward DNS lookup and reverse DNS lookup.
Answer
FeatureForward DNS LookupReverse DNS Lookup
DirectionDomain name → IP addressIP address → Domain name
Record typeA / AAAAPTR
Use caseBrowsing websitesEmail server verification, logging
How it worksQueries A or AAAA recordsQueries PTR records in the .in-addr.arpa zone
Examplewww.example.com → 93.184.216.3493.184.216.34 → www.example.com
FrequencyVery common (every web request)Less common (mainly for email security)

Forward Lookup Example:

Query: What is the IP of www.example.com? Answer: 93.184.216.34 (A record)

Reverse Lookup Example:

Query: What domain is at 93.184.216.34? Answer: www.example.com (PTR record)

Why reverse DNS matters:

  • Email servers use reverse DNS to verify that the sending server's IP matches its claimed domain.
  • Many spam filters reject emails from IPs without valid PTR records.
  • Network troubleshooting tools like traceroute and netstat use reverse DNS.

5. Explain the role of DNS in the Internet ecosystem. Why is DNS called the "phonebook of the Internet"?
Answer

DNS is a fundamental pillar of the Internet. Without DNS, users would need to memorise IP addresses like 142.250.190.4 instead of typing www.google.com.

Why DNS is called the "phonebook of the Internet": Just as a phonebook maps names to phone numbers, DNS maps domain names to IP addresses. When you look up "John Smith" in a phonebook, you get his number. Similarly, when your browser looks up www.example.com in DNS, it gets the IP address 93.184.216.34.

Key roles of DNS:

1. Name Resolution — Translates human-readable domain names to machine-readable IP addresses.

2. Distributed Architecture — DNS is distributed across thousands of servers worldwide, preventing any single point of failure.

3. Load Balancing — DNS can return multiple IP addresses for a single domain, distributing traffic across servers (round-robin DNS).

4. Email Routing — MX records direct emails to the correct mail server for a domain.

5. Service Discovery — SRV records and CNAME records help locate specific services (like FTP servers, SIP servers).

6. Security — DNSSEC (DNS Security Extensions) adds cryptographic signatures to prevent DNS spoofing.

What happens without DNS:

  • Users would need to type IP addresses for every website.
  • Email would be nearly impossible (MX records are essential).
  • The Internet would be unusable for most people.

DNS in everyday life:

  • When you open a website → DNS resolves the domain.
  • When you send an email → DNS MX record finds the mail server.
  • When you use any Internet service → DNS is the first step.

Common Mistakes

1. Confusing A record and CNAME record — A maps a domain to an IP address; CNAME maps a domain to another domain (alias).

2. Mixing up recursive and authoritative servers — Recursive servers do the lookup work for clients; authoritative servers hold the actual records and provide definitive answers.

3. Thinking DNS only translates domain to IP — DNS also handles reverse lookups (PTR), mail routing (MX), aliases (CNAME), and more.

4. Confusing TLD and second-level domain — In www.example.com, .com is the TLD and example is the second-level domain. www is the subdomain/hostname.

5. Forgetting the root in DNS hierarchy — The root (.) is the top of the DNS tree, even though it's usually omitted in URLs. An FQDN includes the trailing dot (www.example.com.).

6. Mixing up MX priority — Lower priority value = higher preference. MX 10 is tried before MX 20.

7. Thinking DNS uses TCP for all queries — DNS primarily uses UDP on port 53 for queries. TCP is used for zone transfers and responses exceeding 512 bytes.


Exam Checklist

  • [ ] Can define DNS and explain its purpose (domain-to-IP translation)
  • [ ] Can describe the DNS hierarchy: Root → TLD → Authoritative
  • [ ] Can explain the DNS resolution process step by step
  • [ ] Know all DNS record types (A, AAAA, MX, CNAME, NS, PTR, SOA, TXT) with examples
  • [ ] Can differentiate between recursive and authoritative DNS servers
  • [ ] Can explain DNS caching and TTL (browser, OS, DNS server)
  • [ ] Can describe forward vs reverse DNS lookups
  • [ ] Can explain domain name structure (root, TLD, SLD, subdomain)
  • [ ] Know that DNS uses UDP port 53 for queries and TCP for zone transfers
  • [ ] Can explain why DNS is called the "phonebook of the Internet"

Frequently Asked Questions

DNS (Domain Name System) is a hierarchical naming system that translates human-readable domain names (e.g. www.google.com) into IP addresses (e.g. 142.250.190.4).
← Browse all Class 12 Exercise Solutions

More exercise solutions