DEV Community

zprostudio
zprostudio

Posted on Originally published at zprostudio.com

How to Fix Slow DNS Lookup: A Practical Windows, macOS, and Linux Guide

Your internet connection can have excellent download and upload speeds while websites still take several seconds to begin loading.

One possible reason is DNS latency.

DNS stands for Domain Name System. Its job is to translate human-readable domain names such as:

example.com

into IP addresses that computers can use to establish a connection.

A simplified process looks like this:

Browser
↓
Local DNS Cache
↓
Operating System
↓
Router
↓
Recursive DNS Server
↓
IP Address
↓
Website

If DNS resolution is slow, the browser may wait before it can establish the connection. ZProStudio's guide identifies several possible causes, including slow DNS servers, network congestion, router configuration, ISP DNS issues, VPN routing, malware, IPv6 configuration, and firewall restrictions.

What Does Slow DNS Lookup Look Like?

DNS problems can be easy to confuse with general internet problems.

Common symptoms include:

A website pauses before loading.
The browser displays “Resolving host.”
Speed tests look normal.
Some websites load quickly while others are slow.
Applications take longer to establish connections.
DNS commands show consistently high response times.

The first step is therefore to measure DNS performance instead of guessing.

How to Test DNS Lookup Time
Windows

Open Command Prompt:

nslookup google.com

You can also use PowerShell:

Resolve-DnsName google.com
macOS and Linux

Use:

dig google.com

or:

host google.com

The goal is to see whether DNS queries are consistently taking unusually long.

What Causes Slow DNS?

  1. DNS Server Latency

Your configured DNS resolver may be geographically distant, overloaded, or otherwise slow for your network.

  1. ISP DNS Problems

Your internet provider's DNS infrastructure may experience performance problems.

  1. Network Congestion

A congested network can increase the time required for DNS packets to travel between your device and the resolver.

  1. Weak Wi-Fi

DNS packets are small, but poor wireless connectivity can still introduce latency and packet loss.

  1. VPN Routing

A VPN can route DNS queries through a server that is farther away than your normal resolver.

  1. DNS Cache Problems

A stale or corrupted local cache can contribute to resolution problems.

  1. Malware

Malware can modify DNS configuration or redirect DNS traffic.

  1. IPv6 Problems

Incorrect IPv6 configuration can sometimes introduce delays during network resolution.

Fix 1: Restart the Router

The easiest first step is restarting your router.

Power it off, wait around 60 seconds, and turn it back on.

This can clear temporary network states and restart network services.

It's simple, but it's worth trying before changing advanced settings.

Fix 2: Flush the DNS Cache
Windows

Run:

ipconfig /flushdns

You can inspect the existing cache with:

ipconfig /displaydns

A DNS cache flush forces Windows to obtain fresh DNS information instead of relying on existing cached entries.

macOS

A commonly used command is:

sudo dscacheutil -flushcache

Depending on the macOS version, DNS caching behavior and commands can differ.

Linux

On systems using systemd-resolved, you can restart the service:

sudo systemctl restart systemd-resolved

Always verify the DNS service used by your Linux distribution before applying service-specific commands.

Fix 3: Change the DNS Server

If your current DNS resolver is slow, test another provider.

Common public DNS services include:

Provider Primary DNS Secondary DNS
Google DNS 8.8.8.8 8.8.4.4
Cloudflare 1.1.1.1 1.0.0.1
Quad9 9.9.9.9 149.112.112.112

These aren't guaranteed to be fastest everywhere.

DNS performance depends on factors such as:

Your location
ISP routing
Network congestion
Resolver infrastructure
IPv4/IPv6 connectivity

So benchmark or test the providers from your own network instead of assuming one will always perform better.

Fix 4: Temporarily Disable the VPN

If you're using a VPN, disconnect it temporarily.

Then repeat the same DNS test.

For example:

Without VPN → 40 ms
With VPN → 250 ms

If the difference is consistent, the VPN's DNS routing may be contributing to the delay.

You can then check whether the VPN allows custom DNS settings.

Fix 5: Test With Ethernet

Wi-Fi isn't always the root cause, but it can introduce additional latency through interference, weak signals, or congestion.

Connect your computer directly to the router using Ethernet and run the same DNS test.

If DNS performance improves, investigate the wireless network.

Check:

Router location
Wi-Fi signal strength
Channel congestion
Distance from router
2.4 GHz vs 5 GHz configuration

ZProStudio's guide also recommends Ethernet testing as a way to identify whether wireless conditions are contributing to DNS latency.

Fix 6: Restart the Windows DNS Client

Windows users can open:

services.msc

Find:

DNS Client

Then restart the service if appropriate.

This can help when the local DNS client is behaving unexpectedly.

Fix 7: Update Router Firmware

Outdated router firmware can contribute to network instability and security problems.

Check the manufacturer's support or administration interface for available firmware updates.

Updates may improve:

DNS forwarding
Security
Network stability
General performance
Fix 8: Check for Malware

If DNS settings keep changing unexpectedly, investigate malware.

Run a full security scan using trusted security software.

Malicious software can modify DNS configuration or redirect requests through unwanted servers.

Fix 9: Check IPv6

Some network environments can have IPv6 configuration issues.

For troubleshooting, you can temporarily disable IPv6 and compare DNS behavior.

If DNS performance improves significantly, investigate the IPv6 configuration instead of permanently disabling it without understanding the underlying issue.

Fix 10: Reset Windows Network Components

For more advanced Windows troubleshooting, try:

netsh winsock reset
netsh int ip reset

Then restart the computer.

This resets important network components and can help when the problem isn't limited to DNS itself.

Useful DNS Troubleshooting Commands

Here's a quick reference:

:: Windows
nslookup google.com
ipconfig /flushdns
ipconfig /displaydns
ipconfig /release
ipconfig /renew
netsh winsock reset

PowerShell

Resolve-DnsName google.com

macOS/Linux

dig google.com
host google.com

These commands are useful for separating DNS problems from general connectivity problems.

DNS Speed vs Internet Speed

Changing DNS doesn't magically increase your internet bandwidth.

For example, if your connection is:

Download: 200 Mbps
Upload: 50 Mbps

Changing DNS won't turn it into:

Download: 500 Mbps

Instead, DNS changes can reduce the time required to resolve domain names.

That can make the beginning of a web request feel faster.

A Practical Troubleshooting Workflow

When investigating slow DNS, avoid changing everything simultaneously.

Use this sequence:

  1. Test DNS ↓
  2. Restart router ↓
  3. Flush DNS cache ↓
  4. Test again ↓
  5. Try another DNS provider ↓
  6. Disable VPN temporarily ↓
  7. Test Ethernet ↓
  8. Check router firmware ↓
  9. Check malware ↓
  10. Investigate IPv6/network configuration

Testing one change at a time makes it much easier to identify the actual cause.

Final Thoughts

Slow DNS lookup can make a fast internet connection feel surprisingly slow.

The good news is that DNS problems are often diagnosable with simple command-line tools and a systematic troubleshooting process.

Start with:

nslookup
dig
Resolve-DnsName

Then work through basic fixes such as restarting your router, flushing the DNS cache, testing another DNS provider, checking VPN behavior, and testing the connection over Ethernet.

For Windows users, commands such as:

ipconfig /flushdns

and:

netsh winsock reset

can also be useful during troubleshooting.

The key lesson is simple:

Don't assume slow website loading means slow internet. Measure DNS performance first, identify where the delay occurs, and then change one thing at a time.

Top comments (0)