How to Fix Slow DNS Lookup: Find the Cause and Speed It Up

A slow DNS lookup makes a website wait before it even starts to load. DNS is the system that turns a name like example.com into an IP address, and your device needs that address to connect. When this step takes too long, every new site feels slow. The cause is often a slow DNS server, a dead server in your settings, or a problem with your router or VPN.

To fix it, measure the DNS time first. Then compare your current DNS server with another one, look for timeouts, and change the setting that causes the delay. The steps below work on Windows, Mac, and Linux. They also cover routers, VPNs, browsers, and website DNS settings.

How to Check Whether DNS Is the Problem

Don’t change any settings yet. First, make sure DNS is really the slow part. A slow page does not always mean slow DNS. If DNS takes 30 milliseconds but the server needs three seconds to reply, the problem is somewhere else.

Measure DNS Time with dig

On a Mac or Linux computer, open Terminal and run this command:

dig example.com

Look for the query time near the bottom of the result. It looks like this:

;; Query time: 25 msec

That number is how long the DNS answer took. To test a public DNS server directly, add its address after an @ sign:

dig @1.1.1.1 example.com
dig @8.8.8.8 example.com
dig @9.9.9.9 example.com

Run each command a few times. The first query can be slower because the server may not have the answer saved yet. Compare repeated results from the same device and network, not a single test.

Windows does not include dig. In PowerShell, you can time a lookup with these two commands. The first uses your configured DNS server. The second queries Cloudflare directly:

Measure-Command { Resolve-DnsName example.com -DnsOnly }
Measure-Command { Resolve-DnsName example.com -Server 1.1.1.1 -DnsOnly }

Check the TotalMilliseconds value in each result and compare the two.

Find Where the Delay Starts with curl

If a site loads slowly, curl can show where the time goes. On a Mac or Linux computer, run:

curl -o /dev/null -s -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nFirst byte: %{time_starttransfer}s\nTotal: %{time_total}s\n" https://example.com

On Windows, use curl.exe and replace /dev/null with NUL:

curl.exe -o NUL -s -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nFirst byte: %{time_starttransfer}s\nTotal: %{time_total}s\n" https://example.com

Each number counts from the start of the request, so it includes the steps before it. The DNS number is the time spent on the lookup. The jump between two numbers shows how long the next step took.

  • A high DNS number means the name lookup is slow.
  • A big jump from DNS to Connect points to a slow network connection.
  • A big jump from Connect to TLS points to a slow secure-connection setup.
  • A big jump before First byte points to a slow server response.

This test keeps you from changing DNS settings when DNS is not the problem.

DNS lookup, connection, TLS, and server response timing stages

Why Is DNS Lookup Slow?

Slow DNS usually comes from one of six places. Knowing which one fits your case tells you which fix to try first.

A Slow or Unreachable DNS Server

Your device sends each lookup to a DNS server. If a configured DNS server does not respond, your device or resolver may retry the query or switch to another server. The timing and fallback behavior depend on the operating system and DNS configuration. Those retries can add delay to new lookups, even when a working backup server is set up.

A Router That Forwards Requests Slowly

Many home routers pass DNS requests from your devices to an upstream server. Many internet providers also supply a combined modem and router. If that unit forwards requests slowly, every device on the same Wi-Fi network can feel the delay.

A VPN With a Distant DNS Server

A VPN often sends DNS requests to its own server. If that server is far away or busy, sites start loading more slowly while the VPN is on.

A Browser Using a Different DNS Provider

Browsers can use a feature called Secure DNS. It may send requests to a provider that is different from the one set in Windows or macOS. That is why a site can feel slow in one browser and normal in another app.

An Empty DNS Cache

DNS servers save answers for a time set by each record’s TTL, or time to live. A saved answer can be returned without another upstream lookup. When there is no cached answer, the resolver has to fetch one. This can add time, especially if the DNS server is slow, but an uncached lookup is not automatically slow.

A Problem With the Website’s DNS Setup

If only one site is slow, the problem may be on its side. Long CNAME chains and slow nameservers can delay lookups. Incorrect delegation or DNSSEC settings can cause lookup failures and, in some cases, additional delays.

How to Fix Slow DNS Lookup

Try these fixes in order. Repeat the same test from the first section after each change, so you know which fix helped.

Use this table to decide where to start:

What you noticeWhere to investigate
Only one device is slowDevice DNS settings, VPN, or local cache
All devices on Wi-Fi are slowRouter, ISP DNS, or network
Only one website is slowThat domain’s DNS records, nameservers, hosting, or CDN
One browser is slowSecure DNS or browser settings

1. Switch to a Different DNS Server

Your current DNS server may be slower than other options. Trying a public DNS server is the quickest way to find out. These are common choices:

ProviderPreferred DNSAlternate DNS
Cloudflare1.1.1.11.0.0.1
Google Public DNS8.8.8.88.8.4.4
Quad99.9.9.9149.112.112.112

No provider is fastest for everyone. Speed depends on your location, internet provider, and network path.

On Windows 11:

  1. Open Settings and select Network & internet.
  2. Choose Wi-Fi or Ethernet, then open the properties of your connection.
  3. Next to DNS server assignment, select Edit.
  4. Choose Manual and turn on IPv4.
  5. Enter a preferred and an alternate DNS address.
  6. Select Save.

On a Mac:

  1. Open System Settings and select Network.
  2. Choose your active connection, then select Details.
  3. Open the DNS tab.
  4. Select the plus button and add the DNS addresses you want to test.
  5. Select OK.

On Linux, set DNS in your network manager or in your systemd-resolved settings. After any change, run the same lookup test again. If the new server is not faster, go back to your old settings.

2. Remove Dead DNS Addresses

Your device may list an old DNS address that no longer answers. If that address comes first, your device or resolver may wait for it before moving to the next one. How long it waits depends on the operating system and DNS setup, but it can add noticeable delay.

First, see which DNS servers your device uses:

SystemCommand
Windows (PowerShell)Get-DnsClientServerAddress
Macscutil --dns
Linux with systemd-resolvedresolvectl status

Then test each address on its own. On Windows, run this in PowerShell:

Resolve-DnsName example.com -Server <dns-address>

On a Mac or Linux computer, run this in Terminal:

dig @<dns-address> example.com

If one address times out while the others answer, you have found the dead one. Next, find out where it came from. It may come from your router, your VPN, a work network, or a manual setting. Remove it only if you are sure you don’t need it, and ask your IT team first if your employer manages the setting.

3. Flush the DNS Cache

Your computer saves DNS answers so it doesn’t have to ask again. An old or wrong saved answer can cause problems, and clearing the cache removes it. Use the command for your system:

SystemCommand
Windows (Command Prompt as administrator)ipconfig /flushdns
Macsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux with systemd-resolvedsudo resolvectl flush-caches

Flushing does not speed up every connection. The next lookups have to fetch fresh answers, so they may take a little longer. Not every Linux system uses systemd-resolved, so check which resolver service yours uses if the command fails.

4. Check Your Router

If many devices on the same Wi-Fi network have slow DNS, look at the router. First, point one computer at a public DNS server, as in fix 1. If that computer is fast, the router’s DNS path is the likely cause.

Restart the router to clear temporary problems:

  1. Unplug the router’s power cable.
  2. Wait about 30 seconds.
  3. Plug it back in and wait for the connection to return.
  4. Test DNS again on the affected devices.

If the problem stays, sign in to the router’s admin page and open the Internet, WAN, DHCP, or DNS settings. The menu names differ by router. Check these items:

  • The DNS addresses are correct.
  • No old custom DNS server is listed.
  • Parental controls or security filters are not slowing DNS requests.
  • No firmware update is waiting.

Avoid a factory reset unless nothing else works. It erases your Wi-Fi name, password, and custom settings.

5. Test Your VPN

A VPN can use its own DNS server instead of yours. Run a DNS test while the VPN is on. Then disconnect it for a short time and run the same test again. If DNS is faster without the VPN, check the VPN’s DNS settings or connect to a closer server. Turn the VPN back on afterward if you need it for work or privacy.

6. Check Whether Port 53 Is Blocked

Standard DNS uses port 53. Most queries use UDP, but DNS also uses TCP, such as when an answer is too large for one UDP reply. A firewall or router rule may block one of them. If you have dig, test both:

dig @1.1.1.1 example.com
dig +tcp @1.1.1.1 example.com

If one works and the other fails, review your firewall and network rules. Don’t turn the firewall off for good. Find the rule that causes the problem and change only that rule.

7. Review Secure DNS in Your Browser

Chrome can send lookups to a Secure DNS provider. This provider may be different from the DNS server on your computer. To check it:

  1. Open Chrome settings.
  2. Select Privacy and security, then Security.
  3. Find Use secure DNS and look at the selected provider.

If a custom provider is chosen, switch to the automatic option and test again. A provider that responds poorly can slow lookups or make them fail. Secure DNS also keeps others on the network from reading your lookups, so weigh that before you turn it off.

8. Compare IPv4 and IPv6 Lookups

Some networks work well on IPv4 but have trouble with IPv6. Compare the two lookup types:

dig A example.com
dig AAAA example.com

The first command checks IPv4 addresses. The second checks IPv6 addresses. If the AAAA lookup is slow or fails, check the IPv6 settings on your router and with your internet provider. Don’t turn IPv6 off as a general fix until you have shown that it causes the delay.

These commands compare DNS responses for IPv4 and IPv6 records. They do not test whether your device can connect over IPv6. If the AAAA lookup succeeds but a website still loads slowly, compare IPv4 and IPv6 connections separately before changing your network settings.

How to Fix Slow DNS for Your Own Website

If your visitors see slow lookups, changing DNS on your own computer won’t help them. You need to check your domain’s DNS records and your DNS host.

Cut Extra CNAME Links

A CNAME record points one name to another. Each link in a chain adds a lookup step. See the chain with this command:

dig www.example.com

For the full path from the root servers, use dig +trace www.example.com. Remove links you don’t need. Keep any records that your CDN, web host, email provider, or domain verification requires.

Choose a Fitting TTL

TTL tells DNS servers how long to save a record. A short TTL means more lookups. A longer TTL means fewer lookups, but changes take longer to reach visitors. Pick a value based on how often the record changes, because no single TTL fits every site.

Test Your Authoritative Nameservers

Authoritative nameservers hold your domain’s DNS records. List them with this command:

dig NS example.com

Then query each one directly by adding its name after an @ sign. Check that each server answers quickly and returns the same records. If one is slow or does not answer, contact your DNS host.

Fix DNSSEC Errors

DNSSEC lets resolvers check that a DNS answer is genuine. A wrong DS record at your registrar, or an expired signature, can make validating resolvers return errors. Compare the DS record at your registrar with the DNSSEC settings at your DNS host. Correct the mismatch instead of turning DNSSEC off.

Use a DNS Host With a Wide Network

Your visitors may come from many regions. Anycast DNS can send each query to a nearby server location, which may shorten the distance. The gain depends on the provider’s coverage. Test from more than one location, not just your office.

How to Confirm DNS Is Faster

After changing your DNS settings, run the same lookup test several times. Use the same domain, device, and network so the results are easier to compare.

For example, if you use dig, compare your current DNS server with Cloudflare, Google Public DNS, and Quad9:

dig example.com
dig @1.1.1.1 example.com
dig @8.8.8.8 example.com
dig @9.9.9.9 example.com

Check the Query time in each result. Repeat the tests a few times and compare the typical response times rather than relying on one result.

If the new DNS server responds faster across repeated tests and websites still load correctly, keep the new setting. If the difference is small or inconsistent, your current DNS provider may already be fast enough.

Also test a few different websites. A DNS server that responds quickly for one domain may not give the same results for every domain.

Frequently Asked Questions

How do I fix a slow DNS server?

Measure its response time and compare it with another DNS server. If the other one is faster and reliable, switch to it on your device or router. If every server is slow, check your router and network.

Is 1.1.1.1 the fastest DNS server?

Not for everyone. Speed depends on your location, internet provider, and network route. Test 1.1.1.1, 8.8.8.8, and 9.9.9.9 on your own connection.

Can slow DNS make the internet feel slow?

Yes, but only at the start of a connection. It delays the moment a page begins to load. It does not affect download speed once the connection is open.

Does flushing DNS make browsing faster?

Not usually. It helps only when a bad saved entry causes the problem. It also clears good entries, so the next lookups may be slower.

Why is DNS slow only on the first visit?

The first lookup may need extra steps because no server has saved the answer yet. Later lookups can use the saved answer until its TTL ends.

Why is DNS slow on Wi-Fi but fast on mobile data?

Your router or home internet provider may be the cause. Test another device on the same Wi-Fi network. If it is slow too, follow the router checks in fix 4.

Can IPv6 cause slow DNS lookups?

It can. A slow AAAA lookup can delay a connection, and a separate IPv6 routing problem can add delay on some networks. Compare the A and AAAA results, then test IPv4 and IPv6 connections separately before you change any settings.

How do I fix a DNS lookup that fails?

Check that your device has a valid DNS server address. Try another DNS server, restart the router, and clear the local cache. If only one site fails, check that domain’s DNS records.

Final Thoughts

Slow DNS has a cause you can measure. Test first, then change one setting at a time. If only one site is slow, look at that domain’s DNS setup. If every site is slow on every device, start with your router and network.

You Might Also Like:
Is 300 Mbps Fast? What You Can Do With 300 Mbps Internet
How to Remove My Personal Data from the Internet

Leave a Comment