Maybe a clue why a Pihole is running slow on DNS lookups

I run a YaCy search engine sometimes and have found these sorts of things in the Pihole logs.
0.0.0.0 (03) 9440 9387
0.0.0.0 (03) 9440 9387.local

I used nslookup and the invalid domains have over 10 seconds delay before an error occurs.
So I think if the domain queries have spaces it maybe an issue.

john@Thinlinc:~$ nslookup abc gsw.undo.it
;; connection timed out; no servers could be reached

john@Thinlinc:~$ nslookup ssdf klm.com
;; connection timed out; no servers could be reached

john@Thinlinc:~$ nslookup shit hot.com
Server: hot.com
Address: 50.22.106.114#53

** server can't find shit.local: REFUSED

Forgive me on the domain name.

It might help diagnosing if you post preceding log lines as well ?

The "nslookup" syntax is:

nslookup <DOMAIN_TO_LOOKUP> <DNS_SERVER_TO_QUERY>

So your trying to lookup the IP address for the "abc" domain trying to query the DNS service at the "gsw.undo.it" host.
I dont think thats what you intended :wink:

Ok thanks that would explain it.

I generate the blocklist from the "query[A] mail.yahoo.com from 192.168.1.10" with my log extractor program in QB64 at https://smokingwheels.github.io/qb64/piholelogext.bas and look for invalid things. There more evident when I run a YaCy search engine.

An Idea? I could feed my Pihole with invalid things and see what happens if it affects performance.

Example:
nslookup hello' 'f.com 192.168.1.5 (Forum leaves out spaces. 5 in total).

Result:
hello\032\032\032\032\032f.com

Ask Browser to contact and result.

I welcome any comments.

Neither FTL nor most other components can deal with spaces in the domain name. Generated log excerpt:

Jan 22 20:33:01 dnsmasq[7849]: 19959 192.168.2.12/51076 query[A] test     123.local from 192.168.2.12
Jan 22 20:33:01 dnsmasq[7849]: 19959 192.168.2.12/51076 forwarded test     123.local to 2001:XXX
Jan 22 20:33:01 dnsmasq[7849]: 19959 192.168.2.12/51076 reply test     123.local is NXDOMAIN

However, albeit being able to trigger this, I doubt spaces are valid parts of domain names, are they?

@DL6ER I have a small collection at https://smokingwheels.github.io/Pi-hole/fromlog

0.0.0.0 chandelur3.tumblr.com.local
0.0.0.0 (space)chanelbags.cheapchanelbags13.us#azqvq
0.0.0.0 (space)chanelbags.topchaneloutletbags.us#xffpc
0.0.0.0 chanell.yandere.local

With normal internet use these are not found.

Those aren't valid domain names. You can't have spaces in a domain name and the octothorpe is an artifact from improper list parsing.

And .local isn't valid either, the TLD is reserved for mDNS and no public DNS server will resolve the name.

$ head fromlog 
0.0.0.0 ([^
0.0.0.0 *****
0.0.0.0 %
0.0.0.0 %0$0" 
0.0.0.0 00dsafari.tumblr.com.local
0.0.0.0 00forest-city00.tumblr.com.local
0.0.0.0 01.e-printphoto.co.uk.local
0.0.0.0 (03) 9440 9387
0.0.0.0 (03) 9440 9387.local
0.0.0.0 03.cbslocal.com.local

Is this your pre-filtered config file or your post-filtered? That list is mostly invalid domain names. You can include them in the dnsmasq configuration, but you're just wasting space as no client will ever query the Pi-hole for them.

Post-filtered list to load onto my Pihole.

It only happens when I run a yacy search engine like now. Maybe I should file a bug report on yacy?

I have partial match for github.com in my lists and may have caused an FTL upgrade to fail today.

Match found in list.10.192.168.1.5.domains:
github.com',
github.com"
github.com'
api.github.com"
pages.github.com">github
api.github.com';
github.com",

Any domain that ends in .local will never be resolved by a public DNS server, so those all can be eliminated. .local is reserved for mDNS and local resolution only.

As for the domains in the list, those are all invalid as well. May want to take a look at your filter script as you shouldn't have those domains in your list. Passing spaces in to FTL is nothing big, they just won't resolve, but passing in ' " or > might cause issues since there's an expectation that the domains would be valid.

2 Likes

FTL is robust against everything you throw at it. However, as @DanSchaper mentioned, this does not mean that you have to expect everything to work fine with illegal characters in domains. Even if FTL can handle them properly, this does not need to extend to other components in the chain (such as the PHP API or the dashboard overall).

1 Like