Tech & Digital 12 min read Medium 7 steps

How to Fix Slow DNS Lookup

Measure your DNS speed first, then flush the cache, restart the router, find a dead server, or switch to Cloudflare, Google, or Quad9 on Windows, Mac, iPhone, Android, or your router.

Published · Last updated
Small white Wi-Fi router with two folding antennas on a wooden desk, a laptop blurred in the background

You will end up knowing whether DNS is what slows your browsing, and with the fix that matches what you find: a flushed cache, a restarted router, a dead server out of the list, or a faster public DNS server. Before your browser can fetch a site, it has to turn the name you typed into a numeric address, and that lookup has to finish before anything else can begin.

Measure before you switch to Google or Cloudflare. On our own Windows 11 PC, our internet provider's DNS was already as fast as Cloudflare's 1.1.1.1 and faster than Google's 8.8.8.8 (the timings are in step 6), so switching would have made our lookups no faster, and Google would have made them slower. That is why step 2 measures before anything changes.

The fixes run from quickest to most involved and cover Windows 11, Mac, iPhone, Android, and your router. The last step also covers the "DNS server not responding" error, which is the same system failing outright instead of slowly.

We ran the Windows timing commands on that PC in September 2026, and checked the Windows commands and settings, the Mac and iPhone DNS settings, the Android Private DNS path, and each provider's addresses and privacy terms against Microsoft's, Apple's, Google's, Cloudflare's, and Quad9's documentation in October 2026.

What you’ll need

A Windows PC or Mac where you can run commands as administrator Your router's admin password, if you want to change DNS for the whole house Pen and paper to note your current DNS settings before you change them

1

Confirm DNS is the slow part

Slow DNS has a particular feel. The first visit to a site hangs on a blank page before anything appears, and the next page on the same site loads quickly. That pattern comes from caching. Once your device has looked up a name, it keeps the answer for a while and skips the lookup next time. In Chrome you may also see Resolving host in the bottom corner of the window while it waits. To check properly, open the site in Chrome, press F12 to open DevTools, choose the Network tab, and reload. Click the first request in the list and open Timing. The DNS Lookup bar is the only part DNS controls. If it takes a few milliseconds and the long bar is Waiting for server response or Content Download, your DNS is fine, and changing it will not speed that page up. If there is no DNS Lookup row at all, the request reused an earlier answer or connection. Clear the cache with step 3 and reload.

Good to know: Notice which devices are affected. If every device in the house hangs, including phones on Wi-Fi, look at the router or your internet provider first. If only one computer does, look at that computer's settings, a VPN, or security software on it.

2

Time your DNS servers against each other

On Windows, open PowerShell as administrator and run this line. It empties the cache, then times one lookup through the DNS server your connection already uses: Clear-DnsClientCache; (Measure-Command { Resolve-DnsName example.com }).TotalMilliseconds Then time the same lookup against public servers by naming them: (Measure-Command { Resolve-DnsName example.com -DnsOnly -Server 1.1.1.1 }).TotalMilliseconds (Measure-Command { Resolve-DnsName example.com -DnsOnly -Server 8.8.8.8 }).TotalMilliseconds Run each one several times and go by the middle result, not the first. Keep the Clear-DnsClientCache part in the first line, or every run after the first is answered from the cache. Without it, ours dropped from 23.5 ms to 8.5 ms, which says nothing about the server. Test a few different sites too. We used five sites and three runs each before trusting any number, because single results jumped around. One lookup took 125.7 ms on a server whose typical answer was under 12 ms. On a Mac, open Terminal and run dig @1.1.1.1 example.com | grep "Query time". Leave out @1.1.1.1 to test the server your Mac is set to use. dig talks to DNS servers directly, so it measures the server rather than everything Safari does on top. A healthy lookup to a nearby server takes tens of milliseconds. If yours regularly takes hundreds, or some take a full second or more, you have found the problem.

Heads up: Skip namebench. Its code was last changed in 2018, and Google archived it in May 2024. GRC's DNS Benchmark tests many servers at once on Windows, but version 2 costs $9.95 as of October 2026, and the commands above answer the question for free.

3

Flush the DNS cache

A cache holding a bad or outdated answer can make one site fail or crawl while everything else works. Clearing it costs nothing. On Windows, open Command Prompt as administrator and run ipconfig /flushdns. It also clears remembered failures, which can keep a site broken after the real problem has gone away. On a Mac, open Terminal, run sudo killall -HUP mDNSResponder, and enter your password. Restarting the Mac clears the cache too. Chrome keeps its own cache. Type chrome://net-internals/#dns in the address bar and click Clear host cache. Flushing fixes stale answers. It does not make a slow server faster, and the first lookup after a flush is the slowest one, because nothing is cached yet. You will also see advice to restart the DNS Client service with net stop dnscache. On our Windows 11 PC the service reports that it cannot be stopped, so that command does nothing useful there.

4

Restart the router and check its DNS setting

If the DNS server your devices use is the router's own address, such as 192.168.1.1, every lookup passes through the router on its way to your internet provider. That middle step is one more thing that can slow down or stall, and a restart clears it. Unplug the modem and the router, wait at least 30 seconds, plug the modem back in first, and wait until its lights settle before you plug the router in. When several devices struggle at once, start here. A fault in the router reaches every device behind it, while a DNS change on one laptop fixes only that laptop. Some routers have a setting called DNS relay or DNS proxy. When it is on, your devices send every lookup through the router. If lookups stay slow after a restart, step 6 lets you point your devices past it.

5

Find a DNS server that does not answer

Windows asks your DNS servers in order and waits for each one. Microsoft's documentation on DNS client timeouts spells out the cost. If the first server does not answer within 1 second, Windows moves on to the next, and if the only working server is fourth in the list, every uncached lookup waits at least 4 seconds. With two servers and a dead one at the top, an uncached lookup can wait a full second before the second server is asked. That is why browsing can feel broken while a download runs at full speed once it has started. To see your list on Windows, run ipconfig /all and look at DNS Servers. Test each address with the Resolve-DnsName line from step 2, putting that address in place of 1.1.1.1. A server that times out or takes seconds is your problem. You cannot delete a server your router hands out, but setting your own servers in step 6 replaces the whole list. On a Mac, the list is under System Settings > Network > your connection > Details > DNS.

6

Switch to a faster public DNS server

Only do this if step 2 showed a public server beating yours by a clear margin. Leave a work or school laptop alone, because its VPN and internal sites depend on the organization's own DNS. A new DNS server also sidesteps any parental controls your internet provider or router applies through DNS. Write down your current settings first, which is also Google's advice before switching to its public DNS, so you can put them back. The three big free options are Cloudflare (1.1.1.1 and 1.0.0.1), Google (8.8.8.8 and 8.8.4.4), and Quad9 (9.9.9.9 and 149.112.112.112). Quad9's addresses also block domains it lists as malicious. DNSPerf, which tests public DNS services from more than 200 locations every minute, averaged Cloudflare at about 14 ms, Google at about 19 ms, and Quad9 at about 22 ms worldwide over the 30 days to September 26, 2026. Those are global averages. From our desk the order was different. Our internet provider's own DNS answered in a median of 11.6 ms, Cloudflare in 12.6 ms, Quad9 in 16.5 ms, and Google in 32.2 ms, so switching would have gained us nothing. Trust your own test over the chart. Windows 11: open Settings > Network & internet, choose Wi-Fi or Ethernet and then your connection, find DNS server assignment, and select Edit. Some versions put that button next to IP assignment instead. Choose Manual, turn on IPv4, and type the two addresses into Preferred DNS and Alternate DNS. If your connection also uses IPv6, turn on IPv6 on the same screen and enter the provider's IPv6 pair too, such as 2001:4860:4860::8888 and 2001:4860:4860::8844 for Google. The same screen can encrypt your lookups with DNS over HTTPS, as Microsoft's page on Windows network settings describes. If you turn it on, leave Fallback to plaintext on, because with it off, Microsoft says a lookup that cannot go over HTTPS is not sent at all. Mac: open System Settings > Network, click your connection, click Details, then DNS. Click the + button, type each address, and click OK. iPhone: go to Settings > Wi-Fi, tap the info button next to your network, tap Configure DNS, choose Manual, add the servers, delete the old entries if you want only the new servers in the list, and tap Save. This applies to that one Wi-Fi network only, not to cellular data. Android: search Settings for Private DNS (Google's own path is Network & internet > Private DNS), choose Private DNS provider hostname, and enter a hostname rather than numbers, such as one.one.one.one for Cloudflare or dns.google for Google. Router: changing it here covers every device in the house at once. Open the router's admin page by typing the Default Gateway address from ipconfig /all into your browser, often 192.168.0.1 or 192.168.1.1, then find the DNS setting in the Internet or WAN section, enter the two addresses, and save. The exact menu names differ by brand.

Heads up: A custom DNS server can get in the way on hotel and cafe Wi-Fi, where the sign-in page relies on the network's own DNS. If a login page will not appear, switch back to automatic, sign in, then switch again.

7

When lookups still hang or fail

If Windows says DNS server not responding, the computer got no answer at all. Run the network troubleshooter first, which Windows 11 keeps in the Get Help app. If that fails, open Command Prompt as administrator, run the five commands below in order, and restart. It is the sequence Microsoft's Wi-Fi troubleshooting page gives: netsh winsock reset netsh int ip reset ipconfig /release ipconfig /renew ipconfig /flushdns If only one computer is affected, look at what sits between it and the internet. A VPN sends your lookups to its own DNS servers. Security software that filters web traffic can add its own delay. If you turned on DNS over HTTPS in step 6, turn it off and test again. If the ipconfig /all list from step 5 includes IPv6 DNS servers, test once with IPv6 switched off on the adapter, then switch it back on. Microsoft recommends against disabling IPv6 because some Windows components might not work without it, so treat this as a test, not a fix. If a public DNS server solves the problem, your internet provider's DNS is the weak point, so tell them. If nothing here changes the DNS Lookup time from step 1, the slowness is somewhere else.

If only one site is slow, flush the caches in step 3 and test again before you change servers. If every device in the house hangs, restart the router (step 4) before you touch any computer. If lookups got slower after the switch in step 6, put back the settings you wrote down. If the first visit to sites is still slow with a VPN connected, run the step 2 test with it off, as FAQ 5 below explains. If the whole computer feels slow, not just page loads, our guides on fixing an overheating laptop and fixing a slow-booting Mac are the next place to look.

Questions we get asked about this

Answers from experience, not a textbook.

On average, yes. DNSPerf's worldwide averages for the 30 days to September 26, 2026 put Cloudflare's 1.1.1.1 at about 14 ms and Google's 8.8.8.8 at about 19 ms. What matters is the distance from you to their nearest server, though. On our connection the gap was bigger than the global figures, and our internet provider's own server beat both (step 6). The PowerShell and dig tests in step 2 give you your own answer.

On your own devices, yes, and you can always switch back to automatic. Cloudflare, Google, and Quad9 all publish privacy policies for their public DNS. Cloudflare says it deletes its resolver logs within 25 hours, Google says its temporary logs holding your IP address are deleted within 24 to 48 hours unless it keeps them longer to deal with security and abuse, and Quad9 says it does not record user IP addresses at all. Leave work and school devices alone, as step 6 explains.

Not directly. DNS only affects the moment before a connection starts, so it does nothing for your ping in a game or the speed of a download once it is running. It can even make things slightly worse. Large sites that serve video and downloads from many locations can pick the copy closest to your DNS server rather than to you, so a DNS server that is far away can point you at a distant copy.

Only when something is wrong. It is a troubleshooting step, not maintenance, and every flush makes your next few lookups slower because the cache starts empty. Restarting your computer clears the cache anyway.

It can. While a VPN is connected, your lookups usually go to the VPN provider's DNS servers, which may be much farther away than your own. On Android 9, Google says a VPN overrides the Private DNS setting, a problem fixed in Android 10. To check whether the VPN is the cause, run the step 2 test with it connected and again with it off.

Because the answer is cached after the first lookup. Your computer, your browser, and often your router each keep recent answers for a set time, so the second visit skips the lookup. Step 2 shows the size of that difference on our PC. If the first visit to every site takes seconds, that is the slow lookup this guide is about.

Like this?

We write one of these every week.

Subscribe for one useful thing a week. Read it over coffee, skip the rest.