Skip to main content

CompTIA A+View full course outline

Domain Name System (DNS)(OBJ.2.3)

By Jonathon Eades — Founder & IT InstructorUpdated

7 min read

Short answer

The Domain Name System (DNS) is a hierarchical, distributed database that translates human-readable domain names into the IP addresses computers use. It uses UDP/TCP port 53. If a host answers a ping by IP address but fails by name, the problem is DNS resolution, not the network path.

The Domain Name System (DNS) is one of the most fundamental services on the internet and in modern networking. Often described as the "phonebook of the internet," DNS translates human-readable domain names (like www.example.com) into IP addresses (like 192.168.1.1 or 2001:db8::1) that computers use to identify each other on networks.

Without DNS, users would need to memorize numerical IP addresses for every website they wanted to visit. DNS makes the internet accessible and user-friendly by allowing people to use memorable names instead of complex numbers.

Why DNS Matters for IT Professionals

Understanding DNS is critical for several reasons. First, DNS issues are among the most common causes of network connectivity problems. Second, proper DNS configuration is essential for network security. Third, many enterprise services depend on DNS for proper functioning, including email, Active Directory, and web services. Finally, DNS troubleshooting is a core competency tested on the CompTIA A+ exam.

How DNS Works

When you type a domain name into your browser, a series of queries occurs behind the scenes to resolve that name to an IP address. This process is called DNS resolution.

The DNS Resolution Process

The DNS resolution process follows these steps:

  1. Local Cache Check: Your computer first checks its local DNS cache to see if it has recently resolved this domain name.
  2. Hosts File Check: If not in cache, the system checks the local hosts file for a static mapping.
  3. Recursive Resolver Query: If still unresolved, the query goes to a recursive DNS resolver (typically provided by your ISP or a service like Google DNS or Cloudflare).
  4. Root Server Query: The resolver queries a root DNS server, which directs it to the appropriate TLD server.
  5. TLD Server Query: The Top-Level Domain server (like .com or .org) directs the resolver to the authoritative name server.
  6. Authoritative Server Response: The authoritative name server returns the IP address, which is then cached and returned to your computer.
Diagram: looking up www.example.com. 1 The computer checks its local DNS cache, 2 then its hosts file, then 3 queries a recursive resolver (ISP, Google or Cloudflare). 4 The root server replies with a referral: ask the .com TLD servers. 5 The .com TLD server refers it to example.com's name server. 6 The authoritative server for example.com answers: www.example.com is 203.0.113.10. The resolver returns the answer, and both it and the computer cache it.
Root and TLD servers refer the resolver onward; only the authoritative server returns the address.

The DNS Hierarchy

DNS operates as a hierarchical, distributed database. This hierarchy consists of several levels:

  1. Root Level: The root zone, represented by a dot (.), contains information about all top-level domains. There are 13 root server clusters worldwide.
  2. Top-Level Domains (TLDs): These include generic TLDs (.com, .org, .net, .edu, .gov) and country-code TLDs (.uk, .de, .jp).
  3. Second-Level Domains: These are the names organizations register, such as "google" in google.com or "microsoft" in microsoft.com.
  4. Subdomains: Additional levels like "www" or "mail" that organizations create under their domain (www.example.com, mail.example.com).
Diagram: the DNS hierarchy. The root (.) with 13 root server clusters at the top; generic TLDs .com, .org, .net, .edu and .gov and country-code TLDs .uk, .de and .jp below it; second-level domains example and microsoft under .com, the names organizations register; subdomains www and mail under example. Read a name right to left: www . example . com . is host, domain, TLD, root.
DNS is a tree: root, then top-level domains, then the domains under them.

DNS Record Types

DNS servers store various types of records, each serving a specific purpose.

Diagram: three more DNS record types besides A, AAAA, CNAME, MX, TXT and PTR. NS (name server) names the authoritative DNS servers for the domain, and the TLD refers resolvers to them, for example example.com NS ns1.example.com and ns2.example.com. SOA (start of authority), one per zone, gives the primary name server, the admin contact, a serial number that changes with each edit, and refresh timers for secondary servers, for example example.com SOA ns1.example.com admin.example.com serial 2026110301. SRV (service locator) points to the host and port that offer a service; Windows clients find Active Directory domain controllers this way, for example _ldap._tcp.example.com SRV dc1.example.com port 389.
NS names a domain's DNS servers, SOA describes the zone, and SRV points to a service's host and port.
RecordPurposeExample Use
AMaps a hostname to an IPv4 addresswww.example.com → 203.0.113.10
AAAAMaps a hostname to an IPv6 addresswww.example.com → 2001:db8::10
CNAMECreates an alias pointing one name to anotherblog.example.com → example.wordpress.com
MXIdentifies the mail servers for a domain, with priority valuesexample.com mail delivered to mail1.example.com
TXTStores arbitrary text, often for verification and email securitySPF, DKIM, and DMARC policies; domain ownership proof
PTRMaps an IP address back to a hostname (a reverse lookup)203.0.113.10 → www.example.com; used by mail servers and by nslookup on an IP address

Configuring DNS Settings

DNS settings can be configured automatically via DHCP or manually.

This lesson is part of ExamWizardz Pro

Unlock every lesson, unlimited practice tests, and the AI tutor.

See Pro pricing

or start with a free account

Test yourself on this topic: free DNS, DHCP, VLANs, and VPNs practice questions — no account needed.

Key terms in this lesson