Pi-hole does not resolve all local host names

Hello,

in my setup, pi-hole is the main DNS server for my local network. pi-hole is configured to ask my fritz.box as primary DNS server. And of cause fritz.box is asking the DNS of my provider.
My fritz.box is configured as DHCP server too. Doing that, I could handle all my IP assignments inside of the fritz.box, and pi-hole handles resolving all host names, the ones in my local network and the ones available via Internet.

Now my prolbem is, that since some time, not all of my local hostnames are properly resolved.

As an example take these command lines:

> host muellernet
Host muellernet not found: 3(NXDOMAIN)
> host muellernet.fritz.box
muellernet.fritz.box has address 192.168.77.116

And when doing the following (192.168.77.1 is my fritz.box), fritz.box returns the proper IP address for all of my hosts:

> host muellernet 192.168.77.1
Using domain server:
Name: 192.168.77.1
Adress: 192.168.77.1#53
Aliases:
muellernet has address 192.168.77.116

> host muellernet.fritz.box 192.168.77.1
Using domain server:
Name: 192.168.77.1
Adress: 192.168.77.1#53
Aliases:
muellernet.fritz.box has address 192.168.77.116

So somehow pi-hole is not able to handle all host names with and without .fritz.box domain.

Any Ideas how this can happen and how I can resolve the issue?
I'm running pi-hole since years now without such an issue, but this one suddenly started some month (?) ago.

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

The token is:
https://tricorder.pi-hole.net/A69Pe0y3/

Your Pi-hole host machine isn't aware of your network's search domain.
(The reason for this may be that your Pi-hole host isn't able to request that from your FB's DHCP server, as that seems absent from your Pi-hole host machine's link).
Without a search domain, the host command may fail to create and issue the appropriate DNS request.

Did you try whether dig would return similar results? E.g.

dig muellernet

and the reverse

dig -x 192.168.77.116

Running dig results in the following output (here I'm running dig on my PC):

> dig muellernet

; <<>> DiG 9.16.20 <<>> muellernet
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 50130
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;muellernet.                    IN      A

;; Query time: 4 msec
;; SERVER: 192.168.77.2#53(192.168.77.2)
;; WHEN: Sun Nov 07 07:22:27 CET 2021
;; MSG SIZE  rcvd: 39
> dig muellernet.fritz.box

; <<>> DiG 9.16.20 <<>> muellernet.fritz.box
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27290
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;muellernet.fritz.box.          IN      A

;; ANSWER SECTION:
muellernet.fritz.box.   4       IN      A       192.168.77.116

;; Query time: 4 msec
;; SERVER: 192.168.77.2#53(192.168.77.2)
;; WHEN: Sun Nov 07 07:22:42 CET 2021
;; MSG SIZE  rcvd: 65
> dig -x 192.168.77.1

; <<>> DiG 9.16.20 <<>> -x 192.168.77.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4678
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;10.77.168.192.in-addr.arpa.    IN      PTR

;; Query time: 8 msec
;; SERVER: 192.168.77.2#53(192.168.77.2)
;; WHEN: Sun Nov 07 07:23:20 CET 2021
;; MSG SIZE  rcvd: 55

But running it on my Pi-hole Raspberry returns this:

> dig muellernet

; <<>> DiG 9.11.5-P4-5.1+deb10u6-Raspbian <<>> muellernet
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21671
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;muellernet.                    IN      A

;; ANSWER SECTION:
muellernet.             9       IN      A       192.168.77.116

;; AUTHORITY SECTION:
muellernet.             9       IN      NS      fritz.box.

;; ADDITIONAL SECTION:
fritz.box.              9       IN      A       192.168.77.2

;; Query time: 1 msec
;; SERVER: 192.168.77.2#53(192.168.77.2)
;; WHEN: So Nov 07 07:26:59 CET 2021
;; MSG SIZE  rcvd: 83
> dig muellernet.fritz.box

; <<>> DiG 9.11.5-P4-5.1+deb10u6-Raspbian <<>> muellernet.fritz.box
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26264
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;muellernet.fritz.box.          IN      A

;; ANSWER SECTION:
muellernet.fritz.box.   9       IN      A       192.168.77.116

;; AUTHORITY SECTION:
muellernet.fritz.box.   9       IN      NS      fritz.box.

;; ADDITIONAL SECTION:
fritz.box.              9       IN      A       192.168.77.2

;; Query time: 1 msec
;; SERVER: 192.168.77.2#53(192.168.77.2)
;; WHEN: So Nov 07 07:27:15 CET 2021
;; MSG SIZE  rcvd: 84
> dig -x 192.168.77.116

; <<>> DiG 9.11.5-P4-5.1+deb10u6-Raspbian <<>> -x 192.168.77.116
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44995
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;116.77.168.192.in-addr.arpa.   IN      PTR

;; ANSWER SECTION:
116.77.168.192.in-addr.arpa. 9  IN      PTR     MuellerNet.fritz.box.
116.77.168.192.in-addr.arpa. 9  IN      PTR     muellernet.fritz.box.

;; AUTHORITY SECTION:
116.77.168.192.in-addr.arpa. 9  IN      NS      fritz.box.

;; ADDITIONAL SECTION:
fritz.box.              9       IN      A       192.168.77.2

;; Query time: 1 msec
;; SERVER: 192.168.77.2#53(192.168.77.2)
;; WHEN: So Nov 07 07:27:27 CET 2021
;; MSG SIZE  rcvd: 143

You said:

Blockquote The reason for this may be that your Pi-hole host isn't able to request that from your FB's DHCP server, as that seems absent from your Pi-hole host machine's link

Were did get the out of the debug log? as you see running dig on the pi-hole machine returns proper results, because my fritz.box is configured as DNS host (i.e. in /etc/resolf.conf). So also running command host meullernet works fine on my pi-hole machine.

Your resolv.conf does not contain your fritz.box search domain, and no DHCP server reports back on your Pi-hole machine's link.

(Click for corresponding debug log excerpts)
*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   
   DHCP packets received on interface lo: 0
   DHCP packets received on interface eth0: 0
*** [ DIAGNOSING ]: contents of /etc
-rw-r--r-- 1 root root 51 Mar  1  2021 /etc/resolv.conf
   nameserver 192.168.77.10

Client software may append the search domain to a DNS request, possibly as an additional request.
You may want to consider to adding a respective search line to your Pi-hole host's resolv.conf.
Your other DHCP clients should have picked up that from your FB's DHCP when acquiring a lease.

Sorry - I see I was not reading your host lookup output with proper attention and wrongly assumed you were running those from your Pi-hole machine.

Your debug log shows that you've ticked Never forward non-FQDN A and AAAA queries under Settings | DNS. So while Pi-hole forwards muellernet.fritz.box to your FB, it won't do so for a plain muellernet.

You could either untick that option (and hit Save) or create the necessary Local DNS records in your Pi-hole.

Thanks a lot, unticking Never forward non-FQDN A and AAAA queries under Settings | DNS fixed the issue. Now it works as expected :slight_smile:

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