Fix Slow DNS Lookup: Step-by-Step Guide
In this article
Slow DNS lookup means your computer takes too long to translate a website name (like example.com) into an IP address, causing lag before pages load. To fix it, you usually need to change your DNS server to a faster one, flush the DNS cache, or adjust your router settings. This guide walks you through the most effective fixes, from quick checks to deeper tweaks.
What You'll Need
- Administrator access to your computer (to change network settings or run commands).
- Access to your router's admin page (usually via a browser at an IP like 192.168.1.1 or 192.168.0.1).
- Optional: A note of your current DNS servers (you can find them in network settings).
Step-by-Step
1. Check If It's Really a DNS Problem
- Open a command prompt (Windows) or terminal (macOS/Linux).
- Run
ping 8.8.8.8(Google's public DNS IP). If you get replies, your internet connection is fine; the issue is likely DNS. - Run
ping example.com. If this fails or times out while the IP ping worked, DNS is slow or broken.
2. Flush the DNS Cache
- On Windows: Open Command Prompt as administrator and run
ipconfig /flushdns. - On macOS: Run
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderin Terminal. - On Linux: Run
sudo systemd-resolve --flush-caches(orsudo resolvectl flush-cacheson newer systems). - This clears corrupted or outdated entries that can cause delays.
3. Change Your DNS Server to a Faster One
- Open your network settings. On Windows: Settings > Network & Internet > Change adapter options. On macOS: System Settings > Network. On Linux: Network settings in your desktop environment.
- Right-click (or control-click) your active connection and select Properties (Windows) or Advanced (macOS).
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties. (On macOS, go to the DNS tab.)
- Choose “Use the following DNS server addresses” and enter a fast, reliable public DNS. Good options:
- Google: 8.8.8.8 and 8.8.4.4
- Cloudflare: 1.1.1.1 and 1.0.0.1
- Quad9: 9.9.9.9 and 149.112.112.112
- Click OK and close all windows. Restart your browser.
4. Update Your Router's DNS Settings
- Log into your router's admin page (check the router's label for the IP and login).
- Find the DNS settings – usually under WAN, Internet, or Network Settings.
- Change from “Obtain automatically” to “Use these DNS servers” and enter the same public DNS addresses as above.
- Save the settings and reboot the router.
5. Disable IPv6 (If Not Needed)
- Some networks have misconfigured IPv6 that causes DNS delays. In your network adapter properties, uncheck “Internet Protocol Version 6 (TCP/IPv6)”.
- This forces all traffic to IPv4, which can speed up DNS lookups if IPv6 is the culprit.
6. Restart Your Router and Modem
- Unplug both devices, wait 30 seconds, then plug the modem back in, wait for it to fully boot, then plug in the router.
- This clears temporary glitches and renews DHCP leases.
Common Mistakes
- Changing DNS on the computer but not the router – devices that use the router's DNS may still be slow.
- Using the wrong IP address for DNS servers – double-check the numbers (e.g., 8.8.8.8 not 8.8.8.0).
- Forgetting to flush the cache after changing DNS – old entries can persist.
- Disabling IPv6 on a network that requires it – some ISPs or local networks rely on IPv6; if you have no IPv4 connectivity, you might lose internet.
Tips
- Test your DNS speed before and after changes with tools like
nslookupor online services (e.g., dnsperf.com). - If you use a VPN, its DNS settings may override your system's – check the VPN app's settings.
- Keep your router firmware updated – manufacturers often improve DNS handling.
- For advanced users, consider running a local DNS resolver like Pi-hole, but that's overkill for most.
Troubleshooting
If the steps above don't fix the slow DNS lookup:
- Check if other devices are affected. If only one device is slow, the issue is likely on that device. If all are slow, it's the router or ISP.
- Try a different public DNS. Sometimes one provider is slow in your region; switch to another.
- Run a malware scan. Malware can hijack DNS settings. Use Windows Defender or a reputable antivirus.
- Check for browser extensions. Some extensions (like ad blockers or VPNs) can interfere with DNS. Disable them temporarily.
- Contact your ISP. If DNS is consistently slow, your ISP's DNS servers may be overloaded. Ask if they have alternative DNS addresses.
- Reset your network stack (Windows): Run
netsh winsock resetandnetsh int ip resetin an admin command prompt, then reboot.
Frequently Asked Questions
Why is my DNS lookup slow even after changing to Google DNS?
Possible reasons: your router still uses old DNS, your ISP may be throttling DNS traffic, or a firewall/security software is interfering. Try changing DNS on the router and disabling any third-party firewall temporarily.
Is it safe to use public DNS like 8.8.8.8?
Yes, major public DNS providers (Google, Cloudflare, Quad9) are safe and widely used. They don't sell your browsing history, and they often have better security features than ISP defaults.
How do I know if my DNS is slow?
Run a command like nslookup example.com and note the time it takes. Or use an online tool like dnsperf.com to compare your current DNS to others. If it takes more than a few hundred milliseconds, it's slow.
Will changing DNS affect my internet speed?
It can affect page load times, but not your raw download/upload speed. DNS only translates names to IPs; the actual data transfer speed is determined by your ISP and plan.
Do I need to change DNS on both my computer and router?
Changing it on the router covers all devices. Changing it on a single computer only affects that device. For a quick fix, change on the computer; for a permanent solution, change on the router.
What does flushing DNS do?
It clears the local cache of previously resolved domain names, forcing your computer to fetch fresh IP addresses. This helps if the cache has corrupted or outdated entries.