Network

DNS: How It Works and Why It Matters for Your Infrastructure

Every click, every API call, every email begins with a DNS query. Understanding how the Domain Name System works is essential for designing reliable, fast and secure infrastructures.

business EasyDataHost calendar_today May 29, 2026 schedule 9 min read

When you type a URL in your browser, when your application calls an external API, or when your mail server delivers a message, the first thing that happens is a DNS query. The Domain Name System is the phone book of the Internet: it translates human-readable names (like easydatahost.com) into IP addresses that machines can route. Without DNS, we would need to memorise numeric sequences for every website.

Despite being an absolutely critical piece of infrastructure, DNS is usually invisible until it fails. A DNS misconfiguration can leave your website unreachable, your emails undelivered, or your server migration turned into a hours-long disaster. Understanding how DNS works and managing it correctly is an essential skill for any infrastructure team.

In this article we explain how DNS resolution works step by step, what record types exist, how TTL and caching affect your changes, what security threats surround the protocol, and what best practices you should apply to your infrastructure.

What is DNS

The Domain Name System (DNS) is a distributed, hierarchical database that maps domain names to IP addresses and other types of information. It was designed in 1983 by Paul Mockapetris (RFC 1034 and 1035) to replace the HOSTS.TXT file that was previously maintained centrally.

DNS works like an inverted tree. At the root are the root servers (13 sets identified by letters A through M, operated by organisations such as ICANN, Verisign, NASA and RIPE). Below them are the TLD servers managing top-level domains (.com, .es, .org). And below those are the authoritative servers for each domain, which hold the actual records.

This distributed architecture is what makes DNS enormously scalable and resilient: there is no single point of failure that can bring down the entire system. Each level of the tree can operate independently and is replicated across multiple geographically distributed servers.

How DNS Resolution Works

When your browser needs to resolve www.easydatahost.com, the following sequence happens in milliseconds:

  • looks_one Local cache: the browser checks its own DNS cache. If no result is found, it queries the operating system cache.
  • looks_two Recursive resolver: if there is no cache hit, the request goes to the configured DNS resolver (your ISP, Cloudflare 1.1.1.1 or Google 8.8.8.8). This resolver does the heavy lifting for you.
  • looks_3 Root server: the resolver asks a root server, which responds with the address of the TLD server responsible for .com.
  • looks_4 TLD server: the .com server responds with the address of the authoritative server for easydatahost.com.
  • looks_5 Authoritative: the authoritative server returns the A record (IPv4 address) or AAAA record (IPv6) for the requested domain.
  • looks_6 Response: the resolver caches the result (according to the TTL) and returns it to the client. The browser can now connect to the obtained IP.

Key fact:

This entire process takes 10-100 milliseconds the first time. Subsequent queries resolve in under 1 ms thanks to the resolver cache.

DNS Record Types

DNS does not only translate names to IPs. It stores different types of information through specialised records:

  • language A: maps a name to an IPv4 address. The most basic and common record.
  • language AAAA: equivalent to the A record but for IPv6 addresses.
  • link CNAME: alias that points one name to another name (not to an IP). Useful for subdomains like www. Cannot be used at the domain apex.
  • mail MX: indicates the mail server for the domain, with priority. Without correct MX records, your email will not be delivered.
  • description TXT: stores arbitrary text. Used for SPF (send authorisation), DKIM (digital signature), DMARC (anti-spoofing policy) and ownership verification.
  • settings SRV: defines service, protocol, port and priority. Used by applications like SIP, LDAP, XMPP and Active Directory.
  • swap_vert PTR: reverse resolution (IP to name). Essential for mail servers to pass anti-spam validation.
  • dns NS: indicates the authoritative name servers for the domain. There must always be at least two.

DNS Caching and TTL

The TTL (Time To Live) is the number of seconds a resolver can cache a DNS response before querying the authoritative server again. It is a critical parameter that directly affects change propagation:

A TTL of 3600 seconds (1 hour) is a common value for stable records. It means that if you change your server IP, clients who already have the record cached will continue pointing to the old IP for up to 1 hour. A TTL of 300 seconds (5 minutes) accelerates propagation but generates more queries to the authoritative server.

DNS caching operates at multiple levels: browser (Chrome caches DNS between 1 and 60 seconds), operating system (the OS stub resolver), recursive resolver (your ISP or Cloudflare 1.1.1.1), and optionally internal DNS servers within the organisation. Each level can retain the record until its TTL expires.

Practical tip:

Before a server migration, lower the TTL to 60-300 seconds at least 48 hours before the change. That way, when you update the IP, propagation will be much faster. Once the migration is complete, raise the TTL back to its normal value.

Comparison Table: Public DNS Providers

Choosing a good public DNS resolver can significantly improve the speed and security of resolution:

Provider IPs Avg Latency Privacy DNSSEC Filtering
Cloudflare 1.1.1.1 / 1.0.0.1 ~11 ms No logs after 24h Yes Optional (1.1.1.2)
Google 8.8.8.8 / 8.8.4.4 ~14 ms Anonymised logs Yes No
Quad9 9.9.9.9 / 149.112.112.112 ~20 ms No personal logs Yes Malware by default
Local ISP Variable 5-50 ms Variable (may log) Sometimes May filter

DNS Security: Threats and Protection

DNS was designed in the 1980s without security mechanisms. Queries travel in plain text over UDP port 53, making them vulnerable to multiple attacks:

  • warning DNS spoofing/poisoning: an attacker injects false responses into the resolver cache, redirecting users to malicious sites without their knowledge.
  • warning DNS amplification: attackers send DNS queries with spoofed source IPs, causing DNS servers to send massive responses to the victim. It is a common type of DDoS attack.
  • warning DNS tunnelling: a technique that encapsulates non-DNS traffic within DNS queries to exfiltrate data or evade firewalls.

Modern solutions include DNSSEC (cryptographic signing of records to verify authenticity), DNS over HTTPS (DoH) which encrypts queries within HTTPS connections on port 443, and DNS over TLS (DoT) which encrypts queries using TLS on port 853. These technologies prevent third parties from snooping on or tampering with your DNS queries.

DNS for Infrastructure

In professional infrastructure environments, DNS goes far beyond resolving website names. It is a fundamental architectural tool:

  • lan Internal DNS: name resolution for servers, databases and services within the private network. Makes management easier by using names instead of IPs in configurations.
  • swap_horiz Split-horizon DNS: returns different IPs based on the query origin (internal vs external). Allows internal services to connect via the private network while external clients use the public IP.
  • manage_search Service discovery: Kubernetes, Consul and other orchestrators use DNS for services to discover each other dynamically.
  • balance DNS load balancing: round-robin DNS distributes traffic across multiple servers by returning different IPs. A basic approach complemented by BGP anycast for greater sophistication.

Common DNS Mistakes

These are the DNS mistakes we see most frequently in infrastructure audits:

  • error Not lowering TTL before a migration: with a TTL of 86400 (24 hours), IP changes can take a full day to propagate. Result: hours of avoidable downtime.
  • error Missing PTR records: without reverse resolution configured, your emails will be rejected or marked as spam by major providers.
  • error Single NS server: if your only nameserver goes down, your entire domain disappears from the Internet. You always need at least two NS on different networks.
  • error CNAME at the apex: a CNAME record at the root domain (example.com) violates the RFC and breaks MX and other records. Use A or ALIAS records instead.
  • error Not monitoring DNS: if you don't watch your domain resolution, you won't learn about problems until users call you.

DNS Best Practices

Follow these recommendations to maintain solid and reliable DNS in your infrastructure:

  • check_circle At least two NS on different networks: never depend on a single nameserver or a single provider for your domain resolution.
  • check_circle Monitor resolution: use tools that periodically verify your DNS records return expected responses from multiple locations.
  • check_circle Enable DNSSEC: sign your DNS zones to protect response integrity. Most modern registrars support it.
  • check_circle Configure SPF, DKIM and DMARC: the three essential TXT records to ensure your email is delivered correctly and not spoofed.
  • check_circle Automate with IaC: manage your DNS records as code (Terraform, Ansible) for versioning, auditing and repeatable deployments.
  • check_circle Separate internal from external DNS: use dedicated DNS servers for internal resolution, independent of public ones, with proper security.

EasyDataHost: DNS and Network

EasyDataHost's network infrastructure is designed so that DNS resolution for your services is fast, redundant and secure:

  • check_circle Carrier-neutral datacenter: multiple connectivity providers ensure DNS queries always have an available route.
  • check_circle Redundant DNS: highly available DNS servers for managed services.
  • check_circle Low latency: presence at ESPANIX and direct peering with major operators for minimal resolution times.
  • check_circle Managed services: DNS configuration, monitoring and maintenance included in management plans.

Conclusion

DNS is the most critical and invisible service on the Internet. A DNS failure has more impact than a server failure, because without name resolution nothing works. Investing time in understanding and correctly configuring your DNS is one of the best decisions you can make for your infrastructure reliability.

  • arrow_right DNS is the distributed database that translates domain names into IP addresses.
  • arrow_right A, AAAA, CNAME, MX and TXT records cover most infrastructure needs.
  • arrow_right TTL controls caching: lower it before migrations, raise it for stability.
  • arrow_right DNSSEC, DoH and DoT protect against spoofing and query snooping.
  • arrow_right Always use at least two NS, monitor resolution and configure SPF/DKIM/DMARC.

If you need help configuring and managing your infrastructure's DNS, contact our team for personalised advice.

DNS DNSSEC Network Infrastructure Security
dns

Reliable and redundant network infrastructure

EasyDataHost: carrier-neutral datacenter in Madrid, ESPANIX peering, managed DNS, low latency and 24/7 support.