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.

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.
What you need
Step-by-step fix
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.
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 TotalMillisecondsTest 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.
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'
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.
dig +trace example.com A dig www.example.com A +noall +answer
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.
; 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.
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.
# 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"
doneFix 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.
# 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'
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.
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
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 freeFAQ
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.
How to Enable HTTP/2 or HTTP/3 on Your Website or CDN
How to Fix Server Uptime: Monitor and Reach 99.9%+
How to Fix Broken AMP Pages and rel="amphtml" Link Errors
How to Fix Missing Security Headers (CSP, Referrer-Policy)
How to Fix Uppercase Characters in URLs (and Redirect Them)
How to Fix Missing Product and Article Schema (JSON-LD)