Slow DNS resolution

Please follow the below template, it will help us to help you!

*If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using nginx instead of lighttpd, or there is some other aspect of your install that is customised) -

I've installed Pihole using a Virtualized Server.

  • Installed OS in this instance is Ubuntu 22.04
  • 4 Vcores / 2 GB Ram / 20 Gb SSD
  • I've also installed Unboud and set an exception for some T-Mobile domains, needed for Wifi calling

Expected Behaviour:

DNS resultion should be working "normal" - So if asking for a website it should open.

Actual Behaviour:

Sometimes when i open a new web page - I get an DNS Error. If I open the page some seconds later - everythinf is working dine

Also i see some strange things happen with my RAM

The command "free -h" shows the follwing:

               total        used        free      shared  buff/cache   available
Mem:           2.0Gi        63Mi       1.9Gi       9.0Mi        20Mi       1.9Gi
Swap:          2.0Gi       0.0Ki       2.0Gi

=> This tells me, that there should no bottelneck with my RAM
but if i use "htop"
the Ram Usage is nearly 100%
-> It is written " MEM : 16.0Z / 2.00G"

But there is no task, which is taking so much ram.

Maybe someone got a similar problem ?

Thanks for helping me.

Debug Token:

https://tricorder.pi-hole.net/iBQB6aeA/

There is nothing in your debug log that would hint at memory being an issue.
In particular, there is no warning message under Pi-hole diagnosis messages.
Pi-hole would notice and log when your system was nearing RAM exhaustion.

Your debug log shows your system is lacking upstream IPv6 connectivity, though your network seems aware of a public IPv6 prefix.
That could have had an impact on your observation of sporadic slow DNS queries if Pi-hole would be configured for an IPv6 upstream - but your Pi-hole is using only IPv4 (which is perfectly fine).

I also note that you are using unbound as one of Pi-hole's upstreams:
(Likely unrelated, there also seems to be a spelling error for the Conditional Forwarding local domain (it's missing the final 'g').)

*** [ DIAGNOSING ]: Setup variables
    PIHOLE_DNS_1=208.67.222.222
    PIHOLE_DNS_2=208.67.220.220
    PIHOLE_DNS_3=127.0.0.1#5335

That is unusual, as it would leak your DNS requests to DNS_1 and DNS_2.
If you'd want to benefit from using unbound as a recursive resolver, then unbound should be Pi-hole's only upstream.
As an initial full recursion can be expected to take longer than just querying a public resolver, this may affect your resolution speed at times when unbound is picked as an upstream every now and then.

Usually, unbound would cache DNS replies, so subsequent DNS requests could be answered instantaneously. However, as your unbound only sees a farction of the DNS requests, it probably would struggle to apply the best caching strategy for yor network.

You should opt to either use unbound or public DNS resolvers.

1 Like

Hey,
thanks for helping me.

I've checked the v6 connectivity. And here - you're right. There was a problem with my firewall ruleset. This is now updated.

Iam sorry for asking, but what do you mean with the this part ?
Maybe you can say - where i shouild look? Which file is meant?

If i get it, now the Unbound resolver is set as the only DNS resolver.

https://tricorder.pi-hole.net/bdKO1cIh/

I believe @Bucking_Horn is referring to the addresses you have set up under Settings/DNS. For a typical Unbound setup, you want to have none of the the DNS servers listed on the left column checked and only your loopback IP with Unbound port listed under the right column.

image

But based on your final statement, you may have already figured that out. Setting the options as above will correct the setup variables mentioned before.

Hey,

this site look similar:
image

And by advanced settings i thicked on:
Never forward non-FQDN A and AAAA queries
Never forward reverse lookups for private IP ranges
Use DNSSEC

Hey,
after some testing, i think that the problem was located by the IPv6 filtering in my firewall.

Until now, it seems to me that the slow replys are gone.

Thanks for this hint!

Mario

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