Insights
How to Fix Slow DNS Lookup
Measure DNS lookup delays on Windows, macOS and Linux, identify the slow layer, apply a targeted fix, and retest without breaking private access.

On this page
Before you change anything, confirm that DNS is actually the source of the delayOpens in a new tab. Run the same hostname query through your current resolver and through an approved alternative. The comparison will point to the layer that needs fixing: stale local answers, a browser DNS override, an unreachable DNS server, router forwarding, or the domain's own authoritative DNS.
Change one setting at a time and rerun the original tests. If a change doesn't help, or it breaks internal names, restore your previous configuration.
In short:
- Measure first: separate DNS time from connection and server time.
- Compare: same hostname, same record type, different resolver.
- Fix one thing, retest, and keep a way back.
Start with a measured, reversible fix
DNS translates a hostname into the address an application needs to connect. A pause before a page loads can come from that lookup, but it can also come from setting up the connection or waiting on the server.
So rather than jumping to a cache flush or a provider switch, work through this sequence:
- Confirm DNS timing. Inspect the affected request, then run a separate hostname lookup.
- Compare repeated queries. Keep the hostname, record type and connection the same while you test your current resolver and an approved alternative.
- Locate the affected layer. Compare browsers, devices and, where you're authorized to, another network.
- Make one matching change. Fix the browser setting, stale answer, resolver configuration or router issue the comparison points to.
- Retest and recover. Check public websites and legitimate private services. Restore the previous configurationOpens in a new tab if performance gets worse or internal names stop resolving.
Save your original settings before changing them. If several devices are affected, focus on their shared router or resolver instead of clearing every device's cache.
Separate DNS delay from connection and server delay
Your browser's request timing shows which phase is slow. A long DNS lookup phase alongside normal connection and response phasesOpens in a new tab means DNS is part of the delay.
- Inspect the affected request. Open your browser's developer tools and go to the Network tab. Reload the page and select the first document request. Look at the DNS lookup, initial connection, TLS negotiation and server response times separately. If DNS timing looks normal, investigate whichever of the other phases is slow.
- Run a DNS-only comparison. Use the commands below for your operating system. These are read-only tests that normally need no administrator rights and leave nothing to undo. Query only destinations and resolvers you're permitted to use.
- Keep the answers and errors. Record the hostname, resolver, returned addresses, elapsed time and any timeout. Repeat the test during a slowdown instead of treating one result as a diagnosis.
Windows PowerShell
This measures a DNS-only query through your configured resolver, then through an approved alternative. Use the same hostname for both.
$hostname = Read-Host "Permitted public hostname"
$baseline = Measure-Command {
Resolve-DnsName -Name $hostname -Type A -DnsOnly | Out-Host
}
$baseline.TotalMilliseconds
$resolver = Read-Host "Approved resolver address"
$comparison = Measure-Command {
Resolve-DnsName -Name $hostname -Type A -DnsOnly -Server $resolver | Out-Host
}
$comparison.TotalMilliseconds
The elapsed time includes some command overhead, so use it to compare runs against each other, not as a packet-level measurement. Keep the displayed answers or errors along with the time.
macOS and Linux
Use dig if it's installed. Replace HOSTNAME and RESOLVER_ADDRESS with the hostname and approved resolver you're testing:
dig HOSTNAME A
dig @RESOLVER_ADDRESS HOSTNAME A
Compare the answer, status and query time. Keep in mind that dig doesn't necessarily follow your browser's Secure DNS settings or the operating system's full name-service path. A fast dig result doesn't rule out an application-specific problem.
Keep IPv4 queries (A) separate from IPv6 queries (AAAA). Also, the first query isn't necessarily uncachedOpens in a new tab, especially at a public resolver, and clearing your device's cache doesn't clear upstream caches. Finally, ping time isn't DNS time, and loading an HTTPS site by IP address isn't a substitute for this comparison.
Use the pattern of failures to choose your next step
The scope of the slowdown narrows down the likely cause. Before changing settings, try another browser, another device and another authorized connection. Each comparison narrows the search, though none proves the cause on its own.
| Symptom | Comparison test | Next step |
|---|---|---|
| Only one browser stalls | Open the same site in another browser on the same device | Check Secure DNS, extensions and proxy settings |
| Only one device struggles | Test another device on the same network | Check device DNS settings, tunnels and active interfaces |
| Every device on the network struggles | Compare wired and wireless, then another authorized network | Investigate the router, upstream resolver and shared path |
| One domain stays slow on every network | Query the same record through several permitted resolvers | Investigate the domain's authoritative nameservers and alias chains |
| A pause ends in eventual success | Test each configured DNS server | Look for unreachable resolvers, timeouts or packet loss |
| Repeat queries get faster | Repeat the same hostname and record type | Account for caching before crediting a setting |
The browser, device and network comparisonOpens in a new tab tells you where to look. If another browser on the same device works fine, look at browser-specific settings. If several devices are affected, look at something they share.
A faster repeat query usually means a cache hit somewhere along the resolution path, not necessarily on your device. If several resolvers slow down together, investigate the shared network path. If an alternative consistently performs better under comparable conditions, look at your configured resolver or its forwarding path.
Correct stale local answers and browser-only problems
If only the browser stalls, check the browser before making system-wide changes. Clearing a local cache is useful after a stale answer or a corrected configuration, but it should be a targeted, one-time actionOpens in a new tab, not routine tuning.
- Compare browser settings. Check Secure DNS, extensions and proxy settings against a browser that works. A browser DNS override can use a different resolver than your operating system. Note each original setting before you change it, and restore it if the change doesn't help.
- Clear a justified local cache. Use the command below only on a device you administer, and only with authorization for administrator or
sudoaccess. - Restart the browser and retest. Query the original hostname and retry the affected page. If only the browser still stalls, go back to its configuration instead of flushing the system cache over and over.
Windows
Run Command Prompt or PowerShell as administrator:
ipconfig /flushdns
macOS
Run these in Terminal with authorized sudo access:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
macOS may not print a success message. Retest the lookup instead of assuming silence means failure.
Linux using systemd-resolved
sudo resolvectl flush-caches
These commands remove cached answers. They don't fix a slow upstream resolver. Caches refill on their own and there's no undo, and flushing repeatedly just throws away the speed benefit of caching.
For advanced Linux troubleshooting, fast direct DNS replies combined with slow application lookupsOpens in a new tab are a reason to inspect the Name Service Switch (NSS) and multicast DNS configuration. Check your distribution's intended name-service path before applying an old configuration tweak you found online.
Repair unreachable resolvers and router forwarding
An unexpected or unreachable DNS server can cause a pause before another one answers. Inspect every configured server on every active interfaceOpens in a new tab, including virtual ones, instead of assuming the visible primary setting tells the whole story.
- Inspect the current configuration. These read-only commands normally need no administrator rights. On Windows PowerShell, use
Get-DnsClientServerAddress(oripconfig /all). On macOS, usescutil --dns. On Linux with systemd-resolved, useresolvectl status. A local stub address points to a resolver service on your device, not necessarily the upstream server. DNS settings can come from DHCP, a network manager or a tunnel, so fix them in whichever system manages them. - Test permitted servers one by one. Use the same hostname and record type as before. Don't assume every listed server is reachable, or that applications use them strictly in the order shown.
- Trial an approved alternative on one device. Save the original addresses, or note that they're assigned automatically, before changing anything. Keep a provider's primary and secondary addresses togetherOpens in a new tab so its filtering policies stay consistent. If the trial fails, restore the recorded values or automatic assignment.
- Check router forwarding when the problem is shared. Where policy allows, compare queries through the router with direct queries to the same upstream resolverOpens in a new tab. A difference points to the forwarding path instead of comparing unrelated providers.
Only restart a router you administer, and warn other users that connections will drop. If the problem comes back, review firmware and DHCP DNS settings before reaching for a factory reset or blanket network reset. After changing DHCP DNS, renew leases or reconnect clientsOpens in a new tab so they pick up the new settings.
Keep private names and DNS protections working
Comparing public resolvers works for public names. Private names need their intended DNS route. A public resolver may know nothing about an internal zone, so replacing DNS globally can make a private service unreachable even if public sites get faster.
- Choose a non-sensitive public hostname. Don't send internal service names to an outside resolver just to measure speed. Test private-service access separately through its intended route.
- Look for overlapping DNS controls. Check browser encrypted-DNS overrides, tunnel-supplied DNS, split DNS, filtering and leftover virtual-interface settings. Split DNS sends different names to different resolvers, so a global replacement can break routing that private access needs.
- Separate tunnel effects only when authorized. For a public site that doesn't need the tunnel, try disconnecting it where policy allowsOpens in a new tab. Do this only if it won't expose sensitive activity, and never disable interfaces needed for managed access.
- Keep protections on. Leave firewall and DNS-rebinding protections enabledOpens in a new tab. If a legitimate internal domain needs an exception, use logs or a narrowly scoped, administrator-approved change.
Encrypted DNS describes how DNS traffic travels. It says nothing about whether a resolver is faster, so judge latency from comparable measurements. When testing is done, restore your intended browser, tunnel and DNS routing. A faster public lookup isn't a fix if it breaks private access or bypasses required filtering.
Investigate authoritative DNS when one domain stays slow
If a domain stays slow across several resolvers and networks, the problem is likely in its own DNS setup. Recursive resolvers fetch and cache answers for clients. Authoritative nameservers publish a domain's records. They're different parts of the lookup path.
- Confirm the domain-specific pattern. Compare the same record type through several permitted recursive resolvers. If other domains resolve normally, check the affected domain's authoritative nameserversOpens in a new tab.
- Inspect delegation and authoritative replies. On macOS or Linux with
dig, the read-only commands below normally need no administrator rights. Replace the placeholders, and use them only where direct DNS traffic is allowed. - Act according to ownership. If you administer the domain, check nameserver availability, delegation and unnecessary alias chains. If you don't, send reproducible results to the domain operator.
dig ZONE NS
dig @AUTHORITATIVE_SERVER HOSTNAME A +norecurse
dig HOSTNAME A +trace
ZONE is the relevant DNS zone, and AUTHORITATIVE_SERVER is one of its nameservers. The direct query asks that server for an answer without requesting recursion, because an authoritative server doesn't provide the general recursive service your usual resolver does. A delegation trace follows the lookup path, but restricted direct DNS traffic can stop it from completing.
For a slow domain, a delegation trace can help you investigate authoritative servers or a CNAME alias chainOpens in a new tab. Review TTL settings against how often your records change. TTL controls how long DNS records are cached, not how fresh page content is, and it isn't a universal speed setting.
If DNS replies are quick but the browser shows slow TLS or initial connection timingOpens in a new tab, move your investigation to that phase. Changing DNS records won't fix a delay somewhere else.
Verify the improvement and keep a recovery path
A real fix improves the original symptom while keeping answers correct and required access working. Faster timing alone isn't enough if lookups fail, return unsuitable answers or stop resolving private services.
- Repeat the original comparison. Use the same domains, record types, connection and timing method after your single change. Keep several timings and failuresOpens in a new tab, not just the fastest result.
- Check real behavior. Retry the affected browser or application and your legitimate private services. Confirm the answers are expected, errors haven't increased and the original pause has improved.
- Keep a compact before-and-after record.
| Item | Before | After |
|---|---|---|
| Resolver and connection | Original addresses (or automatic assignment) and active connection | The single setting you changed |
| Same hostnames and record types | Typical timings, answers and failures | Repeated timings, answers and failures |
| Original symptom | Where the application pauses | Whether that pause improved |
| Private access | Required services resolve and connect | Access still works as intended |
- Restore or escalate. If results get worse, restore your recorded DNS settings and any browser or tunnel changes. Then send the problem to whoever owns the layer you isolated: the device administrator, router administrator, internet provider, resolver operator or domain operator.
When you escalate, include timestamps, the resolver in use, the relevant public hostname, returned results or errors, and which devices are affected. Say whether the slowdown is in DNS timing or a later connection phase, and which comparisons reproduce it. Redact private names and sensitive logs before sharing.