CompTIA Network+ Preparation · lesson 4 of 30 · 25 min
How DNS Works
DNS (Domain Name System) translates human-readable domain names (Tech Camp for Kids.com) into IP addresses (93.184.216.34). It is the “phone book” of the internet, operating on UDP port 53 (queries) and TCP port 53 (zone transfers).
DNS resolution process: 1. Client checks local cache. 2. Queries recursive resolver (usually ISP or 8.8.8.8). 3. Resolver queries root nameserver (.). 4. Root refers to TLD nameserver (.com). 5. TLD refers to authoritative nameserver. 6. Authoritative nameserver returns the answer. 7. Resolver caches and returns to client.
TTL (Time to Live) — how long a DNS record is cached. Low TTL = changes propagate quickly but more DNS queries. High TTL = fewer queries but slower propagation.
Authoritative nameserver — the definitive source for a domain’s DNS records. Configured by the domain owner.
Recursive resolver — performs the full lookup on behalf of the client. Caches results to speed up future queries.
DNS Record Types
Each DNS record type serves a specific purpose. The Network+ exam tests all of these:
SPF (Sender Policy Framework) — TXT record listing authorised mail servers for a domain. Prevents email spoofing.
DKIM (DomainKeys Identified Mail) — TXT record containing a public key used to verify email signatures.
DMARC — TXT record that tells receiving servers what to do when SPF/DKIM checks fail (none, quarantine, reject).
CNAME restrictions: A CNAME cannot coexist with other records at the same name. You cannot have a CNAME at the zone apex (root domain) — use an A record or ALIAS record instead.
Exam Tip
MX records point to a hostname (never directly to an IP). PTR records live in the in-addr.arpa zone. CNAME cannot be used at the zone apex. TXT records are used for SPF, DKIM, and DMARC email authentication.
Key Terms
Key Terms
Knowledge Check — 10 Questions
Network+ — DNS Record Types
Which DNS record maps a hostname to an IPv4 address?
- AAAA
- PTR
- A
- CNAME
Answer: A
A record = hostname to IPv4. AAAA = hostname to IPv6. PTR = IP to hostname. CNAME = hostname alias.
An MX record points to:
- An IP address directly
- A hostname of the mail server
- A CNAME alias
- A PTR record
- Answer: A hostname of the mail server
MX records must point to a hostname (A or AAAA record), never directly to an IP address.
Which record type is used for reverse DNS lookups?
- A
- CNAME
- PTR
- NS
Answer: PTR
PTR (Pointer) records map IP addresses back to hostnames. They live in the in-addr.arpa zone for IPv4.
SPF, DKIM, and DMARC records are stored as which record type?
- MX
- SRV
- TXT
- NS
Answer: TXT
TXT records store arbitrary text — used for email authentication (SPF, DKIM, DMARC) and domain ownership verification.
A CNAME record cannot be used at:
- Subdomains
- The zone apex (root domain)
- Mail servers
- IPv6 addresses
- Answer: The zone apex (root domain)
CNAME at the zone apex (e.g., Tech Camp for Kids.com itself) is not allowed by DNS standards — use an A record or ALIAS record instead.
Which DNS record contains zone metadata including the primary nameserver and serial number?
- NS
- SOA
- SRV
- PTR
Answer: SOA
SOA (Start of Authority) contains zone metadata: primary NS, admin email, serial number, and refresh/retry/expire timers.
DNS uses which port for standard queries?
- 443
- 53
- 80
- 123
Answer: 53
DNS uses UDP port 53 for queries (fast) and TCP port 53 for zone transfers (reliable). Port 53 is the DNS port.
A low TTL on a DNS record means:
- The record is more secure
- Changes propagate quickly but more DNS queries are generated
- The record never expires
- The record is cached longer
- Answer: Changes propagate quickly but more DNS queries are generated
Low TTL = short cache time = faster propagation of changes but higher DNS query load. Used when planning IP changes.
Which record type specifies the authoritative nameservers for a domain?
- A
- MX
- NS
- SOA
Answer: NS
NS (Nameserver) records identify the authoritative DNS servers for a domain — where DNS queries for that domain should be directed.
AAAA records map hostnames to _____ addresses.
Answer: IPv6
AAAA records are the IPv6 equivalent of A records. The name comes from IPv6 being 128 bits = 4x the 32 bits of IPv4.
Previous lesson: TCP three-way handshake, connection termination, UDP characteristics
Back to CompTIA Network+ Preparation
Next lesson: DHCP process: DORA, scopes, leases, options, relay agents