The Domain Name System (DNS) is a fundamental part of modern networking and Internet infrastructure. Whenever a user visits a website, connects to an application, sends an email, or accesses a service by hostname, DNS may be involved in locating the destination.
DNS is commonly described as the system that translates domain names into IP addresses. That description is correct, but incomplete. DNS is a distributed, hierarchical naming system that supports service discovery, email routing, delegation, caching, and several important security mechanisms.
Understanding DNS is essential for network administrators, system administrators, cybersecurity professionals, cloud engineers, and anyone responsible for maintaining reliable IT infrastructure.
This guide explains the architecture of DNS, the roles of its main components, common record types, caching, DNS security, and practical troubleshooting. It also links to dedicated CorgiNetwork guides for topics that require deeper technical coverage.
DNS stands for Domain Name System.
It allows applications and users to work with recognizable names instead of having to remember numerical network addresses.
For example, a user can enter:
www.example.com A DNS lookup may return an IPv4 address such as:
192.0.2.10 The address above belongs to a documentation-only address range and is used here as an example, not as a real website destination.
DNS does more than resolve website names. It can also provide information about:
DNS is therefore a naming and service-location system, not simply a website-to-IP converter.
To understand how DNS fits into the wider communication process, see our Computer Networking Explained guide and TCP/IP Explained.
DNS uses a distributed hierarchy. No single DNS server needs to store the complete information for every domain on the Internet.
A simplified DNS namespace looks like this:
.
└── com
└── example.com
├── www
├── mail
└── api The hierarchy has several important levels.
DNS root
The root is at the top of the DNS namespace. Root servers provide referrals that help resolvers find the nameservers responsible for Top-Level Domains.
Top-Level Domains (TLDs)
TLDs appear at the end of domain names. Examples include:
.com.org.net.uk.fr.maRegistered domains
A registered domain is located beneath a TLD. For example, example.com is beneath .com.
Subdomains and hostnames
A domain can contain additional names, such as:
www.example.com
mail.example.com
api.example.com This hierarchy allows responsibility for different parts of the namespace to be delegated to different DNS operators.
The root-zone infrastructure and delegation information are coordinated through IANA’s Root Zone Management.
Several components work together when an application needs to resolve a domain name.
A stub resolver is the DNS client component used by an operating system or application.
When a user opens a website, the application requests the address associated with its hostname. The stub resolver may check available local information and then send a query to a configured recursive resolver.
A recursive resolver receives DNS queries from clients and attempts to return a final answer.
It may obtain the answer from its cache. If the answer is not available or has expired, it can contact other DNS servers to continue the lookup.
Recursive resolvers may be operated by:
Root servers provide referrals toward the nameservers responsible for the requested TLD.
There are 13 named root-server identities, commonly identified by letters A through M. This does not mean that the global root-server system consists of only 13 physical machines. The infrastructure is distributed across many locations and instances.
TLD nameservers provide delegation information for domains registered beneath their TLD.
For example, a .com TLD server can refer a resolver to the authoritative nameservers for example.com.
An authoritative DNS server provides the DNS records for the zone it serves.
It is the authoritative source for that zone’s published DNS data. It does not normally need to perform the complete recursive lookup process for every query.
| Feature | Recursive Resolver | Authoritative Server |
|---|---|---|
| Main purpose | Finds DNS answers | Publishes zone data |
| Queries other DNS servers | Yes, when needed | Not for normal authoritative answers |
| Caches responses | Usually | Not as a recursive resolver |
| Source of authoritative zone data | No | Yes |
| Common role | ISP or public resolver | Domain DNS provider |
These roles may be provided by separate services, although some DNS software can perform more than one role when configured to do so.
Consider a user opening:
www.example.com The application needs to obtain an address before it can normally establish a connection to the destination hostname.
A simplified lookup process is:
Application
|
v
Operating System / Stub Resolver
|
v
Recursive DNS Resolver
|
+---- Cache lookup
|
+---- Root DNS server
|
+---- TLD nameserver
|
+---- Authoritative DNS server
|
v
DNS response
|
v
Application connects to destination The process generally follows these steps:
Actual resolution can be shorter because of caching, local policies, forwarding, or other resolver behavior.
For a detailed explanation of the request and response sequence, including root, TLD, and authoritative queries, read How DNS Resolution Works.
DNS records store information associated with names in a DNS zone.
The following are some commonly used record types:
| Record | Purpose |
|---|---|
| A | Maps a hostname to an IPv4 address |
| AAAA | Maps a hostname to an IPv6 address |
| CNAME | Creates an alias to another hostname |
| MX | Identifies mail servers for a domain |
| TXT | Stores text data used by verification and other services |
| NS | Identifies nameservers for a zone |
| SOA | Contains administrative information about a DNS zone |
| PTR | Supports reverse DNS lookups |
| SRV | Identifies hosts and ports for specified services |
| CAA | Specifies which Certificate Authorities are authorized to issue certificates for a domain |
For example, an A record can be represented as:
www.example.com. 3600 IN A 192.0.2.10 The value 3600 is the record’s TTL in seconds.
A CNAME record points to another hostname rather than directly to an IP address:
www.example.com. IN CNAME example.com. A standard CNAME record also has restrictions on which other record types can coexist at the same owner name.
DNS record configuration depends on the authoritative DNS provider and the requirements of the service using the records.
For field-by-field explanations and configuration examples, see DNS Record Types Explained.
A DNS zone is an administratively managed portion of the DNS namespace.
A zone contains records and delegation information for the names it is responsible for serving.
For example, a DNS zone for example.com might contain:
example.com. IN A 192.0.2.10
www.example.com. IN CNAME example.com.
example.com. IN MX 10 mail.example.com.
example.com. IN NS ns1.example.net.
example.com. IN NS ns2.example.net. A zone file may also contain an SOA record and other records required by the domain’s services.
Delegation allows responsibility for a child zone to be assigned to different authoritative nameservers. This is one of the reasons DNS can scale across a very large global namespace.
A domain’s registrar, DNS hosting provider, and web hosting provider may be different companies. The registrar manages domain registration and delegation settings, while the authoritative DNS provider publishes the zone records.
Changing a website’s hosting provider does not necessarily require changing the domain registrar.
DNS caching reduces repeated queries and improves response time.
When a recursive resolver receives a response, it can store the result for the period allowed by the record’s TTL and applicable DNS rules.
For example:
example.com. 3600 IN A 192.0.2.10 A TTL of 3600 seconds represents one hour.
Caching can occur at several layers, including:
When a DNS record changes, users may continue receiving an older answer while a resolver or client still has a valid cached response.
This is one reason DNS changes do not necessarily become visible everywhere immediately.
Negative responses can also be cached under DNS negative-caching rules. This means that caching is not limited to successful record lookups.
The TTL is not a single global propagation timer. Different records and resolvers can have different cache states.
For detailed examples of TTL behavior, negative caching, and stale DNS responses, see DNS Caching and TTL Explained.
Traditional DNS commonly uses UDP or TCP on port 53.
UDP is commonly used for ordinary DNS queries because it has low transport overhead.
TCP is also an important DNS transport. It is used for zone transfers and may be used for regular DNS queries and responses, including cases where response size or network conditions require it.
DNS implementations and networks must not assume that DNS always uses UDP. Blocking TCP port 53 can cause legitimate DNS operations to fail.
See RFC 7766 for DNS over TCP implementation requirements.
DNS over TLS protects DNS traffic between the client and resolver using TLS.
It is commonly associated with TCP port 853.
The specification is documented in RFC 7858.
DNS over HTTPS carries DNS queries and responses over HTTPS.
It can use the same HTTPS infrastructure commonly used by web applications, typically over port 443.
The protocol is specified in RFC 8484.
DoT and DoH protect the DNS communication channel between endpoints. They do not replace DNSSEC and do not automatically prove that every returned DNS record is authentic.
Traditional DNS responses are not inherently protected by cryptographic signatures.
An attacker who can successfully interfere with a DNS response may attempt to provide false information to a resolver or client.
DNS Security Extensions (DNSSEC) add cryptographic signatures to DNS data. A validating resolver can use these signatures and the chain of trust to verify that signed DNS data is authentic and has not been modified.
Important DNSSEC record types include:
DNSSEC protects DNS data integrity and origin authentication through validation. It does not encrypt ordinary DNS queries and does not hide the domain names being requested.
DoH and DoT address privacy and protection of the transport channel, while DNSSEC addresses authentication and integrity of signed DNS data. These technologies solve different problems.
For a deeper technical explanation of the DNSSEC chain of trust, read DNSSEC Explained.
For failures involving SERVFAIL responses, DS records, DNSKEY mismatches, or expired signatures, see DNSSEC Troubleshooting.
DNS supports more than public website access. It is also important in enterprise networks, cloud infrastructure, and internal applications.
Organizations may use internal DNS zones to resolve private hostnames.
For example:
fileserver.corp.example
database.corp.example
monitoring.corp.example Split-horizon DNS can return different DNS answers depending on the network or resolver making the request.
An internal client may receive a private address, while an external client receives a public address or a different response.
This is useful for internal services, but it requires careful DNS and network security design.
Email delivery depends on several DNS records and authentication mechanisms.
Common examples include:
_dmarcA domain can have a working website while its email configuration is incorrect.
For reliable email delivery, DNS records must be consistent with the mail provider’s configuration.
Some DNS providers use anycast routing to advertise the same IP address from multiple network locations.
Routing directs clients toward an available instance according to the network’s routing decisions.
Anycast can improve resilience and response performance, but it does not remove the need for correct DNS records, reliable authoritative servers, and monitoring.
Some applications use SRV records or other DNS mechanisms to discover services.
This can be useful in enterprise networks and distributed systems where applications need to locate services by name rather than depend on fixed server addresses.
A typical public website may depend on several different DNS record types.
For example, a simplified domain configuration might include:
example.com. IN A 192.0.2.10
www.example.com. IN CNAME example.com.
example.com. IN MX 10 mail.example.com.
example.com. IN TXT "v=spf1 ..."
_dmarc.example.com. IN TXT "v=DMARC1; p=..." These are illustrative records only. The actual values and syntax must come from the website host, mail provider, and DNS provider.
The responsibilities are different:
A reliable setup should use the DNS provider’s required nameserver configuration, maintain valid records, avoid unnecessary duplicates, and monitor changes to critical records.
DNS configuration should be tested after migrations, hosting changes, mail-provider changes, and security-policy updates.
DNS problems can look similar to application, routing, firewall, or server failures.
A structured investigation helps identify the actual cause instead of changing records without evidence.
Determine:
Testing the exact hostname and record type makes the investigation more reliable.
On Linux, use:
dig www.example.com A To check MX records:
dig example.com MX On Windows, use:
nslookup www.example.com To inspect an A record with PowerShell:
Resolve-DnsName www.example.com -Type A A resolver-specific query can help determine whether the problem is limited to one recursive resolver.
For example:
dig @1.1.1.1 example.com A You can compare the result with the resolver configured on the affected device.
However, public resolvers are not necessarily suitable for testing private corporate zones. Split-horizon DNS and internal naming policies may produce intentionally different answers.
Identify the domain’s authoritative nameservers and query the relevant server directly.
A typical query is:
dig @ns1.example.net www.example.com A +norecurse Replace the nameserver and hostname with the real values for the domain.
An authoritative response can help distinguish incorrect zone data from a stale recursive cache or delegation problem.
If the authoritative server has the correct data but recursive resolvers return an error, investigate the delegation and validation path.
Check:
For detailed DNSSEC failures, use the dedicated DNSSEC Troubleshooting guide.
If authoritative DNS returns the new record but a recursive resolver returns an older answer, investigate caching.
Check the remaining TTL and compare responses from different resolvers.
Flushing a local DNS cache can help when the stale entry is on the affected device, but it does not clear caches on public recursive resolvers across the Internet.
A successful DNS response does not guarantee that the destination application is reachable.
After obtaining the IP address, check:
For example, a browser can fail to load a website even when DNS resolution is correct.
Our guides to Firewalls Explained and Network Security Basics provide additional context for investigating network access problems.
The following commands are useful during routine DNS investigations.
Query an A record:
dig example.com A Query an AAAA record:
dig example.com AAAA Query a specific resolver:
dig @1.1.1.1 example.com A Trace the DNS delegation path:
dig +trace example.com Query a DNSSEC-enabled response:
dig example.com +dnssec Check resolution through systemd-resolved:
resolvectl query example.com For more networking and diagnostic utilities, see Linux Network Tools Guide.
Query a hostname:
nslookup example.com Query an MX record:
nslookup -type=MX example.com Use PowerShell to query an A record:
Resolve-DnsName example.com -Type A Inspect the local DNS client cache:
Get-DnsClientCache Display the Windows DNS cache:
ipconfig /displaydns Clear the local DNS resolver cache when appropriate:
ipconfig /flushdns Flushing the local cache does not change authoritative DNS records and does not clear the caches of external recursive resolvers.
DNS is part of the infrastructure that applications and users rely on. Incorrect configuration or weak administration can affect availability, privacy, and security.
Common threats include:
Recommended practices include:
DNS security should be part of the wider network security program, alongside firewall policies, identity management, endpoint protection, and monitoring.
DNS stands for Domain Name System. It is the distributed naming system used to locate resources and services by name.
A client sends a DNS query to a resolver. The resolver may answer from its cache or query the DNS hierarchy, including root, TLD, and authoritative nameservers, to obtain the requested record.
A recursive resolver finds answers for clients and can cache responses. An authoritative DNS server publishes the records for the zone it serves.
An A record maps a hostname to an IPv4 address. An AAAA record maps a hostname to an IPv6 address.
Resolvers and clients may have cached older answers. The time before those answers expire depends on TTL values and applicable caching behavior. Delegation changes can also involve cached information.
Traditional DNS uses both UDP and TCP, commonly on port 53. TCP is required for certain operations and can also be used for ordinary DNS queries and responses.
No. DNSSEC provides cryptographic authentication and integrity for signed DNS data. It does not encrypt ordinary DNS queries.
Both can protect DNS traffic between a client and resolver. DoH carries DNS messages over HTTPS, while DoT carries them over TLS. They use different transport approaches and deployment models.
Yes. DNS may return the correct address while the destination server, routing path, firewall, TLS configuration, or application is unavailable.
Split-horizon DNS provides different DNS answers depending on the client or network making the request. It is often used to separate internal and public name resolution.
DNS is a core service that connects human-readable names with the network resources used by applications and infrastructure.
Understanding its hierarchy, recursive and authoritative roles, record types, caching behavior, transport protocols, and security mechanisms makes it easier to design and troubleshoot reliable networks.
For practical administration, DNS should be monitored and documented like other critical infrastructure services. Changes to records, delegation, DNSSEC, and email authentication should be tested carefully.
A strong understanding of DNS also provides a foundation for learning more advanced topics such as DNSSEC validation, DNS troubleshooting, Linux network administration, and cloud networking.
Further reading: How DNS Resolution Works · DNS Record Types Explained · DNS Caching and TTL Explained · DNSSEC Explained
Introduction Border Gateway Protocol (BGP) is the routing protocol used to exchange network reachability information…
Introduction A Linux server can experience connection failures even when its network interface is working…
Introduction TCP retransmissions are an important indicator of network reliability and performance. When a Linux…
Open Shortest Path First (OSPF) is a link-state routing protocol widely used in enterprise networks…
Group Policy is one of the most important management features in Windows Server Active Directory…
Windows DNS servers play an essential role in Active Directory environments, allowing computers, servers, applications,…