Slow response for pi-hole


Hi all,

Im’ using pi-hole on debian 9.

Because I don’t want to use the embedded dnsmasq from pihole, I’m using my unbound DNS server to ask pi-hole dnsmasq’s DNS as a forwarder.

I’ve seen the pi-hole is quite slow to respond. It add above 80ms of time for a resolution.

Any way to try to understand why?

I got a debug file here:




How do you have your Pi connected to your network and what is it’s assigned IP address on the network? In your debug log you have Pi-Hole listening on the Pi loopback address (

What port is unbound listening on?

I don’t quite understand what you are doing here. Why don’t you want to use embedded dnsmasq?

What is the flow path for a DNS request from a client to a final return of an IP address?

Is it client > unbound > Pi-Hole > DNS resolver (in your case, etc.)




My router is not a raspberry but a apu from pcengines. But quite same.

I use from years an unbound dns server with a lot of local entries configuration. I just made pihole running on localhost only on port 5353, modifying the dnsmasq conf (which is lost at every updates)

I use the pihole dns as a forwarder on unbound server, in place of classic internet dns.

It’s running very well but quite slow.

For a client, the dns is the router. The unbound responds (for local entries) or ask pihole on localhost:5353 for internet entries.

Technically it’s not different as standard usage. Normally its :
Client -> unbound (router) -> internet dns forwarder (
Here it’s :
Client -> unbound (router) -> pihole (router) - > internet dns forwarder (

It just seems this add 80ms ton resolution time :s



How did you diagnose ?

dig @

dig @$(hostname -I)

dig @$(hostname -i) -p 5353

Do mind that caching might influence results!



I saw it on my monitoring.
I made some continuous ping to internet.
Normally I’m above 20-30ms. With pihole it add 80ms for dns resolution.

-> on router
dig @ |grep Query
;; Query time: 14 msec

-> Unbound only (using as forwarder):
dig @localhost |grep Query
;; Query time: 15 msec

(after other tries are 0ms, because of cache)

-> pihole :
dig @localhost -p 5353 |grep Query
;; Query time: 180 msec

-> unbound + pihole (localhost:5353 as forwarder):
dig @localhost |grep Query
;; Query time: 80 msec



With Pi-Hole and unbound as an upstream resolver on a Pi-3B+, I get this response, which is typical:

dig @localhost -p 5353 |grep Query
;; Query time: 20 msec

Have you considered reversing the order of Pi-Hole and unbound? Put Pi-Hole on port 53 and unbound on

DNS queries go to Pi-Hole first, then to unbound if upstream resolution is needed.

Changing the Pi-Hole port back to normal would also solve this problem.

1 Like

closed #8

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.