Перейти к содержимому
Skip to content
← All articles

DNS Performance: Optimizing Resolution Speed

How DNS Affects Loading Speed

Every HTTP request begins with DNS resolution — converting a domain name to an IP address. This process takes 20 to 120ms, and for the first visit to a domain, up to 200-300ms. On a page with resources from 10 different domains, DNS Lookup can add 1-2 seconds to load time.

DNS resolution is an often-overlooked performance factor that can be optimized without code changes.

How DNS Resolution Works

  1. Browser checks its DNS cache
  2. If not found — request to the OS (hosts file, system cache)
  3. OS queries the recursive resolver (usually ISP or public DNS)
  4. Resolver traverses the chain: root → TLD → authoritative DNS server
  5. The obtained IP address is cached at each level according to TTL

Use DNS Lookup on Enterno.io to check DNS records and resolution time for your domain.

Choosing a DNS Provider

Authoritative DNS server speed directly affects first-visit time. Public DNS providers with anycast networks deliver 5-20ms response times from anywhere in the world.

Selection Criteria

Popular DNS Providers

Optimizing TTL

TTL (Time To Live) determines how long a DNS record is cached. The right TTL is a balance between performance and flexibility.

TTL Recommendations

Too-low TTL (under 60 seconds) increases DNS server load and slows resolution. Too-high TTL (over 86400) makes urgent changes difficult.

DNS Prefetch

DNS Prefetch is a mechanism for pre-resolving domains from which page resources are loaded:

<link rel="dns-prefetch" href="//cdn.example.com">
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="dns-prefetch" href="//analytics.google.com">

The browser performs DNS lookups in advance while parsing HTML. When the resource is needed, the IP address is already cached.

Preconnect — Going Further

For critical resources, use preconnect — it performs DNS + TCP + TLS handshake in advance:

<link rel="preconnect" href="https://cdn.example.com" crossorigin>

Use preconnect for the 2-3 most important external domains. For the rest, use dns-prefetch.

Minimizing DNS Lookups

Reduce the Number of Domains

Each unique domain requires a separate DNS lookup. Reduce external domains:

Domain Sharding — An Outdated Technique

In the HTTP/1.1 era, resources were spread across multiple domains for parallel downloads. With HTTP/2, this is an anti-pattern — multiplexing allows everything through one connection. Extra domains only add DNS lookups.

DNS Monitoring

DNS issues often go unnoticed because the site "works" for most users (their DNS cache is still valid).

Summary

DNS optimization is low-hanging fruit that requires no code changes. Choose a fast DNS provider with anycast, set proper TTLs, use dns-prefetch and preconnect for external domains, and minimize the number of unique domains on the page. These measures can save 100-500ms on every page load.

Check your website right now

Check now →
More articles: DNS
DNS
How to Choose the Perfect Domain Name: A Complete Guide
16.03.2026 · 22 views
DNS
DNS Propagation — Why DNS Changes Don't Work Immediately
12.03.2026 · 10 views
DNS
DNSSEC: How DNS Security Works and Why You Need It
13.03.2026 · 8 views
DNS
DNS Record Types: A, AAAA, MX, CNAME, TXT and More
10.03.2025 · 11 views