The upstream DNS server is refusing to respond to Pi-hole’s queries. This is happening because either the upstream server itself is overloaded, or Pi-hole is sending too many requests for it to handle.

1. Upstream DNS Server Congestion

Your chosen upstream DNS server (e.g., Google DNS, Cloudflare DNS) is experiencing high traffic or is temporarily unavailable. This is the most common reason for slow DNS resolution in Pi-hole.

Diagnosis: Run dig or nslookup directly from the Pi-hole host to the upstream server.

dig @8.8.8.8 google.com

If this command is slow or times out, the issue is likely with the upstream server itself.

Fix: Switch to a different, more reliable upstream DNS provider. Many providers offer public DNS services. For example, Cloudflare’s DNS servers are 1.1.1.1 and 1.0.0.1.

In the Pi-hole web interface, navigate to Settings -> DNS. Under "Upstream DNS Servers," uncheck your current provider and check Cloudflare or enter custom server IPs like 1.1.1.1 and 1.0.0.1. Click "Save."

This works because a different, less congested DNS server will respond to your queries much faster, bypassing the bottleneck.

2. Network Latency to Upstream DNS Server

High latency or packet loss between your Pi-hole host and the upstream DNS server can significantly slow down responses. This is more common if you’re using a geographically distant or unreliable upstream provider.

Diagnosis: Use ping to measure the round-trip time to your upstream DNS server.

ping 1.1.1.1

Look for high average times (consistently over 50ms) or a high percentage of packet loss.

Fix: Select an upstream DNS server that is geographically closer to your Pi-hole host. If you’re in Europe, consider a European-based DNS provider.

In the Pi-hole web interface, navigate to Settings -> DNS. Under "Upstream DNS Servers," select providers known for low latency in your region, or enter custom IPs of servers closer to you.

This improves speed by reducing the physical distance data must travel, leading to quicker responses.

3. Pi-hole’s Internal Caching Issues

While caching is meant to speed things up, a misconfigured or overloaded cache can sometimes cause delays. This is less common but can occur with very high query volumes.

Diagnosis: Check the Pi-hole query log (/var/log/pihole.log) for repeated queries that are slow to resolve. You can also monitor the "DNS queries today" and "Unique domains" in the Pi-hole dashboard. If these numbers are extremely high and consistently show slow responses, caching might be a factor.

Fix: Clear the Pi-hole’s DNS cache.

On the Pi-hole host’s terminal, run:

pihole -f

This command flushes the DNS cache, forcing Pi-hole to re-fetch records from upstream servers. This can resolve temporary inconsistencies in the cache that might be causing delays.

4. Insufficient Resources on the Pi-hole Host

If the device running Pi-hole (e.g., a Raspberry Pi) is underpowered or overloaded with other processes, it may struggle to handle DNS requests efficiently, leading to delays.

Diagnosis: Check the CPU and RAM usage on your Pi-hole host.

top

or

htop

If CPU usage is consistently near 100% or RAM is nearly full, the host is likely struggling.

Fix: Allocate more resources to the Pi-hole host. This might involve:

  • If running on a VM/container: Increase allocated CPU cores and RAM.
  • If running on dedicated hardware (e.g., Raspberry Pi): Ensure it’s not running other heavy processes, or consider upgrading to a more powerful model (e.g., Raspberry Pi 4 or newer).
  • Reduce other services: If other applications are running on the same device, consider moving them to a different machine.

Providing more processing power allows Pi-hole to handle queries and cache lookups much faster.

5. Firewall or Network Configuration Blocking/Slowing DNS

A firewall (either on the Pi-hole host, your router, or an intermediary network device) might be inspecting or rate-limiting DNS traffic, causing delays.

Diagnosis: Temporarily disable any firewalls on the Pi-hole host or router and test DNS speed. On Linux, sudo ufw disable can temporarily disable UFW. Consult your router’s manual for disabling its firewall.

Fix: Configure your firewall to allow unrestricted UDP/TCP port 53 traffic to and from your Pi-hole’s IP address, especially for outgoing requests to upstream DNS servers.

For example, if using ufw on the Pi-hole host:

sudo ufw allow 53/udp
sudo ufw allow 53/tcp
sudo ufw reload

Ensuring DNS traffic is not being interfered with allows it to flow unimpeded to and from the upstream servers.

6. Upstream DNS Server Rate Limiting

Some public DNS providers implement rate limiting to prevent abuse. If your network generates an unusually high volume of unique DNS queries, you might be hitting these limits, causing your queries to be delayed or dropped.

Diagnosis: Check the logs of your upstream DNS provider for any indications of rate limiting or unusual query volumes. This can be difficult to diagnose directly from Pi-hole. A good indicator is if all your upstream DNS servers become slow simultaneously.

Fix: Switch to an upstream DNS provider that has higher or no rate limits, or use a combination of providers to distribute the load. Alternatively, consider running your own recursive DNS server (like Unbound) locally, which has no external rate limits.

In Pi-hole’s Settings -> DNS, you can add multiple upstream servers. Ensure you have at least two different providers checked.

This distributes your query load across multiple servers, reducing the chance of hitting a rate limit on any single one.

The next error you’ll likely encounter after fixing slow DNS is "Connection timed out" for certain websites, indicating a different networking issue or a problem with the domain itself.

Want structured learning?

Take the full Pihole course →