Skip to main content
Your first session is free. Claim mine
PacketMentor logo
Open menu
Home
Training
CCNA Library (74)
Browse all CCNA topics →
Network (13)
Device Operations (5)
Network Access (12)
Wireless (6)
IP Connectivity (10)
IP Services (11)
Security (10)
Automation (7)
CCNP Library (15)
LabsPricing
Contact 📞 +1 (860) 556-3010 Book a Call
← All topics
IP Services Foundational

DNS — Domain Name System

How www.example.com becomes an IP address. Covers the recursive query path (root → TLD → authoritative), record types (A, AAAA, CNAME, MX, PTR), TTL caching, and the most common DNS failure modes.

TL;DR
  • DNS translates names humans type into IP addresses computers need. Without it, the internet is just a list of numbers.
  • A recursive resolver does the legwork — walks root → TLD → authoritative server — then caches the answer for the TTL.
  • Common record types: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), PTR (reverse), TXT (anything text).

Mental model

Your laptop wants to load www.packetmentor.com. The browser has no idea what IP that is. So it asks a resolver (usually your ISP’s, or 8.8.8.8, or 1.1.1.1) to find out.

The resolver doesn’t know either — but it knows where to start asking. It walks a chain:

  1. “Hello root, who runs .com?” Root answers: “Ask the .com TLD servers.”
  2. “Hello .com, who runs packetmentor.com?” TLD answers: “Ask packetmentor.com’s authoritative server.”
  3. “Hello packetmentor.com auth, what’s the IP of www?” Auth answers: “203.0.113.42.”

The resolver returns just the final answer to your laptop. It also caches the answer for the duration specified by the record’s TTL (Time To Live) — so the next person asking gets the answer instantly without walking the chain again.

Record types you need to know

TypePurposeExample
AName → IPv4 addresswww.example.com → 203.0.113.42
AAAAName → IPv6 addresswww.example.com → 2001:db8::1
CNAMEAlias to another namewww → example.com.
MXMail server for the domainexample.com → mail.example.com (priority 10)
NSAuthoritative nameserver for the zoneexample.com → ns1.example.com
PTRIP → name (reverse DNS)42.113.0.203.in-addr.arpa → www.example.com
TXTAnything text (SPF, DKIM, domain verification)v=spf1 ...
SOAStart of Authority — zone metadatarefresh, retry, expire, TTL

For CCNA: A and AAAA are by far the most asked. Understand CNAME (it’s a pointer, not a copy) and MX (it’s what mail servers query to deliver email).

TTL — the caching contract

Every DNS record has a TTL (in seconds). When a resolver caches an answer, it holds it for that long before re-asking.

TTLWhen to use
300 (5 min)Aggressive — for records you might change soon
3600 (1 hr)Normal default
86400 (24 hr)Stable records that rarely change

Migration tip: before changing an A record’s IP, lower the TTL to 300 a day in advance. Wait for the old TTL to expire everywhere. Then change. New IP propagates in 5 min instead of a day.

Commands

Query DNS from a Cisco router

R1# nslookup www.packetmentor.com
R1# show host

Configure DNS resolver settings

R1(config)# ip name-server 8.8.8.8 1.1.1.1
R1(config)# ip domain-lookup
R1(config)# ip domain-name corp.local

ip domain-lookup is on by default. The annoying side-effect: if you mistype a command, the router tries to DNS-resolve it as a hostname, which times out for ~30 seconds before giving you the prompt back. Most engineers disable it:

R1(config)# no ip domain-lookup

Configure a Cisco IOS DNS server (rare in production, but exam-relevant)

R1(config)# ip dns server
R1(config)# ip host www.corp.local 10.0.0.50

DNS as a troubleshooting layer

When users say “the internet is down”, the issue is often DNS — not the network. Ping fails by hostname but succeeds by IP? DNS problem. The classic flow:

$ ping www.example.com        ← fails with "unknown host"
$ ping 203.0.113.42           ← works

That’s a DNS failure, not a network failure. Common culprits: ISP DNS server down, local cache poisoning, misconfigured resolver, network adapter has no DNS server assigned.

Common mistakes

  1. No reverse DNS for an outbound mail server. Many mail receivers reject mail from IPs without a matching PTR record. If you run a mail server, set up the PTR record at your ISP for that IP.

  2. TTL too long during migration. A 7-day TTL means a week of half the internet seeing your old IP after a change. Lower TTLs before migration, not after.

  3. CNAME at the apex. RFC says you can’t have a CNAME on the apex (root domain) — only on subdomains. Most modern DNS providers offer “ALIAS” or “ANAME” pseudo-records to work around this.

  4. Forgetting ip domain-lookup is on by default. Mistype a command, wait 30 seconds, curse the router. Always disable on lab/admin routers.

  5. Putting unauthorized DNS servers in your name-server list. A typo’d IP could send queries to a malicious server logging everything you look up. Stick to well-known public resolvers (8.8.8.8, 1.1.1.1, 9.9.9.9) or your own internal one.

  6. Confusing recursive and authoritative. Recursive resolvers do the legwork. Authoritative servers answer for the zones they own. Most public servers do both, but they’re conceptually distinct.

Lab to try tonight

  1. From your laptop, run dig www.cisco.com (or nslookup on Windows). Note the answer + TTL.
  2. Run it again immediately — the second response is from cache, should be much faster.
  3. Run dig +trace www.cisco.com — watch the recursive walk happen step-by-step from root to TLD to authoritative.
  4. On a Cisco router, configure ip name-server 1.1.1.1. Then run ping www.cisco.com and verify DNS resolution works.
  5. Disable ip domain-lookup. Mistype a command. Confirm you no longer wait 30s for the prompt.
  6. Bonus: change the TTL on a test domain you control. Watch propagation time difference.

Cheat strip

ConceptPlain English
ResolverThe server that walks the query chain on the client’s behalf
Authoritative serverThe server that owns the record (the “source of truth”)
Root → TLD → AuthThe three steps of a recursive lookup
TTLHow long answers stay cached. Lower = faster propagation, more lookups.
A / AAAAIPv4 / IPv6 address records
CNAMEAlias (pointer) to another name
MXMail server for the domain
PTRReverse lookup — IP to name
no ip domain-lookupDisables DNS on the router CLI to avoid mistype delays
Master this on a real network

Want this drilled into reflex?

1:1 weekly sessions, live feedback on your labs, and US interview prep — built around the CCNA® exam blueprint. Free first session. No card on file until you decide.

Claim my free session →

One topic per email, every fortnight

VLANs, OSPF, ACLs, subnetting, automation — written like this. Unsubscribe in one click.

We respect your inbox. One email per week, max. Unsubscribe any time.

Start typing — or browse popular topics below.

↑↓ navigate open Searches topics · labs · programs · pages