How to Fix Slow DNS Response Time for Your Website

Before a browser or crawler can download your page, it has to resolve your domain name to an IP address. If your authoritative nameservers are slow, far away or misconfigured, that lookup adds hundreds of milliseconds before anything else happens. By the end of this guide you will have measured your DNS lookup time, removed the common causes of slow resolution and, if needed, moved your zone to a fast anycast DNS provider.

By Updated ⏱ 30-60 minutes (plus up to 48 hours for nameserver changes to propagate)🎯 Intermediate● Low impactTechnical
Illustration: DNS response time fix guide
TECHNICAL · FIX GUIDE DNS response time IMPACTEFFORT TIME30-60 minutes (plus up to 48 hours for nameserver changes to propagate) LEVELIntermediate

Why it matters

DNS time is part of every uncached first visit, so it feeds directly into Time to First Byte and Largest Contentful Paint for new visitors, mobile users on fresh connections and search or AI crawlers fetching your pages. Our audit passes lookups under 150ms, warns between 150ms and 400ms, and flags anything slower. The ranking effect is small on its own, but slow or flaky DNS also causes intermittent timeouts.

When a lookup fails, crawlers simply cannot reach the site.

✕BeforeDNS lookup took 620ms from the auditserver: example.com uses a singleregistrar-default nameserver and a✓AfterDNS lookup took 38ms from the auditserver: example.com is served byanycast nameservers with a direct A

What you need

Login to your domain registrar (where you change nameservers)
Login to your current DNS host (often the registrar or web host)
A terminal with dig (macOS/Linux) or PowerShell Resolve-DnsName (Windows)
An account with a managed anycast DNS provider if you need to migrate

Step-by-step fix

1

Measure your current DNS lookup time

Measure a lookup from a couple of networks so you know the baseline. The Query time line in dig output is the number to watch. Run it several times, because the first query is uncached and the slowest.

That cold lookup is closest to what a crawler or first-time visitor experiences. On Windows, wrap Resolve-DnsName in Measure-Command.

text
dig example.com A +stats | grep -E 'Query time|SERVER'
dig www.example.com A +stats | grep 'Query time'

# Windows PowerShell
Measure-Command { Resolve-DnsName example.com -Type A -DnsOnly -NoHostsFile } | Select-Object TotalMilliseconds
Pro tip: Query a public resolver directly (dig @1.1.1.1 or @8.8.8.8). Your office or ISP resolver may have a warm cache that hides the problem.
2

Test each authoritative nameserver directly

List your nameservers, then query each one with recursion off. This shows how fast the servers you control actually answer.

  • A healthy anycast nameserver answers in roughly 5-40ms from most locations.
  • One server that is slow or times out drags down the average, because resolvers try servers at random and retry after timeouts.
  • status: REFUSED or no answer from a listed server means a lame delegation, which you should fix in the next steps.
text
dig NS example.com +short

# Then for each nameserver returned:
dig @ns1.example-dns.net example.com A +norecurse +stats | grep -E 'status|Query time|flags'
Pro tip: Look for the 'aa' flag in the response. If it is missing, that server is not authoritative for your zone.
3

Trace the full resolution path

Use dig +trace to follow the lookup from the root servers, through the TLD, to your nameservers and then any CNAME targets. Every extra hop adds a round trip. Common culprits are:

  • www pointing to a CNAME, which points to another CNAME, which finally points to an A record.
  • Nameservers whose own hostnames sit in a slow or distant zone with no glue records.
  • An old provider still listed at the registrar.
text
dig +trace example.com A
dig www.example.com A +noall +answer
Pro tip: If the answer section shows two or more CNAME lines before the final A or AAAA record, flatten the chain.
4

Flatten CNAME chains and raise sensible TTLs

In your DNS host's zone editor, point records as directly as possible:

  • At the apex, use an A/AAAA record, or the provider's CNAME flattening / ALIAS / ANAME record if your host requires a hostname.
  • For www, use a single CNAME to your host's final target, not to another alias you control.
  • Set TTLs on stable records to 3600 (1 hour) or higher so resolvers serve cached answers more often. Only lower TTLs temporarily before a planned migration.
text
; Before
www.example.com.   300  IN CNAME  site.example.com.
site.example.com.  300  IN CNAME  lb.examplehost.net.

; After
example.com.       3600 IN A      203.0.113.10
www.example.com.   3600 IN CNAME  example.com.
Pro tip: Very low TTLs (30-60s) left over from an old migration force resolvers to go back to your nameservers constantly. Check for them first.
5

Move the zone to a fast anycast DNS provider

If your nameservers are still slow after the fixes above, switch to a managed anycast DNS provider. Registrar-default and shared-hosting DNS are the usual culprits. Do it in this order:

  • 1) Export your zone, or copy every record by hand: A, AAAA, CNAME, MX, TXT (SPF, DKIM, DMARC, verification), CAA and SRV.
  • 2) Import it at the new provider and compare record by record.
  • 3) Lower TTLs at the old provider 24 hours ahead.
  • 4) Change the nameservers at your registrar.

Keep the old zone active until propagation finishes.

text
# Confirm the new provider serves identical answers BEFORE switching nameservers
for r in A AAAA MX TXT CAA; do
  diff <(dig @old-ns1.example-host.net example.com $r +short | sort) \
       <(dig @new-ns1.example-dns.net example.com $r +short | sort) && echo "$r OK"
done
Pro tip: Missing MX or DKIM TXT records are the most common migration accident. Send a test email right after the switch.
6

Fix delegation and DNSSEC at the registrar

Make sure the nameservers listed at your registrar exactly match the NS records inside your zone. Remove any old servers that no longer host the zone. If DNSSEC is enabled, update the DS record at the registrar to the one your new provider shows.

Alternatively, disable DNSSEC at the registrar before migrating and re-enable it afterwards. A stale DS record makes validating resolvers fail lookups completely, which shows up as 'DNS lookup failed' in the audit.

text
# Registrar delegation (as seen by the TLD)
dig NS example.com @a.gtld-servers.net +norecurse +noall +authority

# NS records inside your zone
dig NS example.com @new-ns1.example-dns.net +short

# DNSSEC check
dig DS example.com +short
dig example.com A +dnssec @1.1.1.1 | grep -E 'status|flags'
Pro tip: With working DNSSEC, the flags line from a validating resolver includes 'ad'. SERVFAIL usually means a DS mismatch.
7

Re-test and re-run the audit

Once dig +trace shows only the new nameservers, repeat the measurements from step 1 using a few public resolvers, then re-run the audit. Aim for cold lookups well under 150ms. Results can vary by a few milliseconds because the audit measures from its own server location.

Repeated failures or values over 400ms point back to a slow nameserver or broken delegation.

text
for s in 1.1.1.1 8.8.8.8 9.9.9.9; do
  echo -n "$s: "; dig @$s example.com A +stats | grep 'Query time'
done
Pro tip: Use an online global DNS checker to confirm the new nameservers are returned from several continents before you decommission the old zone.

Platform-specific notes

Cloudflare

Cloudflare DNS is anycast and usually answers in under 30ms. Add the domain, review the imported records under DNS > Records, then replace the nameservers at your registrar with the two Cloudflare assigns. CNAME flattening at the apex is automatic. If you use DNSSEC, enable it under DNS > Settings and add the DS record it shows at your registrar.

Amazon Route 53

Create a public hosted zone, then copy its four NS values (spread across .com, .net, .org and .co.uk) to your registrar. Use Alias records instead of CNAMEs for the apex and for AWS targets such as CloudFront or ALB. Alias queries are answered directly without an extra lookup.

Shopify

Domains bought through Shopify use Shopify's DNS. Edit them under Settings > Domains > [domain] > DNS settings. For third-party domains, keep DNS at a fast provider and point the apex A record to Shopify's IP and www as a CNAME to shops.myshopify.com, as shown in Shopify's domain setup screen. Do not chain extra CNAMEs in front of it.

Wix / Squarespace

If you connected the domain by nameservers, DNS is hosted by the website builder and you can only edit records in its domain dashboard. To use a faster provider, switch to the 'pointing' or A/CNAME connection method so DNS stays at your provider. Then add the A and CNAME records the builder specifies.

Registrar default DNS (e.g. shared hosting cPanel)

Free DNS bundled with registrars or cPanel hosts is often unicast from one data center, which makes it the most common cause of 300ms+ lookups. Export the zone (in cPanel, use Zone Editor and copy all records) and move it to an anycast provider. Keep the domain registered where it is.

Check that it worked

✅ How to verify

  • Run dig example.com A +stats against 1.1.1.1 and 8.8.8.8 several times. Cold Query time should be under 150ms and repeat queries near 0-20ms.
  • Run dig +trace example.com and confirm only the intended nameservers appear and each returns an answer with the 'aa' flag.
  • Check DNSSEC status with dig example.com +dnssec @1.1.1.1. You should see NOERROR, not SERVFAIL.
  • Re-run the audit and confirm the DNS response time check reports a value under 150ms.

⚠️ Common mistakes

  • Switching nameservers before copying every record, which breaks email (MX, SPF, DKIM) or domain verification TXT records.
  • Leaving an old DNSSEC DS record at the registrar after changing providers, which makes lookups fail outright on validating resolvers.
  • Measuring only from a warm local resolver and concluding DNS is fast when cold lookups from other networks are slow.
  • Keeping 60-second TTLs indefinitely after a migration, so resolvers keep re-querying the nameservers instead of serving cached answers.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

What is a good DNS response time for a website?

An uncached lookup under 100-150ms is good, and 20-50ms is typical for anycast providers. Between 150ms and 400ms is worth improving. Above 400ms usually means slow, distant or misconfigured nameservers.

Does DNS lookup time affect SEO?

Indirectly and modestly. It adds to Time to First Byte and LCP for first-time visitors and crawlers. Failed or timed-out lookups can stop Googlebot from fetching pages, which matters more than a few milliseconds.

Will changing DNS providers cause downtime?

Not if you copy all records first, lower TTLs a day ahead and keep the old zone active during propagation. Resolvers get identical answers from either provider while the change spreads, usually within a few hours and at most about 48 hours.

Should I use dns-prefetch or preconnect to speed up DNS?

Those hints only help with third-party domains your page loads after the HTML arrives. They cannot speed up the lookup of your own domain, which happens before any HTML is downloaded. That lookup is only fixed with fast authoritative nameservers and sensible TTLs.