How to make pihole resolve the name of the host it is installed on?

I installed a Pi-hole in a docker container (Docker Tag 2022.07.1, Pi-hole v5.11.4, FTL v5.16.1, Web Interface v5.13) running on a RPi host (Linux raspberrypi 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux).

Almost everything works: the DHCP server provides IPs to clients, I can resolve internal names (from DHCP) and external ones both from the Pi-hole and any client.

The one thing that does not work: the resolution of the name of the host (the Rpi) itself. Below is an attempt to resolve a public host, an internal host and the RPi itself from a Windows 10 client that received its IP from Pi-Hole:

PS C:\Users\yop> nslookup
Default Server:  pi.hole
Address:  192.168.0.2

> lemonde.fr
Server:  pi.hole
Address:  192.168.0.2

Non-authoritative answer:
Name:    lemonde.fr
Address:  151.101.2.137

> chromecast.home.arpa
Server:  pi.hole
Address:  192.168.0.2

Name:    chromecast.home.arpa
Address:  192.168.0.177

> raspberrypi.home.arpa
Server:  pi.hole
Address:  192.168.0.2

Name:    raspberrypi.home.arpa
Addresses:  fe80::909c:4c34:b85e:b6c8
          0.0.0.0

> exit

PS C:\Users\yop> ping raspberrypi.home.arpa
Ping request could not find host raspberrypi.home.arpa. Please check the name and try again.

I have updated the name in /etc/hosts to account for the local domain home.arpa and did not make any adjustments beyond that:

root@raspberrypi:~# cat /etc/hosts
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1               raspberrypi.home.arpa

What am I missing?

Having this resolution is quite importnat for me because I have other containers and would like to CNAME their name to raspberrypi.home.arpa.

Debug Token:

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

Thank you. I made the change to add a domain to dnsmasq and set PIHOLE_PTR to HOSTNAMEFQDN and it does not completely work:

PS C:\Users\yop> nslookup
Default Server:  raspberrypi.home.arpa
Address:  192.168.0.2

> raspberrypi.home.arpa
Server:  raspberrypi.home.arpa
Address:  192.168.0.2

Name:    raspberrypi.home.arpa
Addresses:  fe80::909c:4c34:b85e:b6c8
          0.0.0.0

> mqtt.home.arpa
Server:  raspberrypi.home.arpa
Address:  192.168.0.2

Name:    raspberrypi.home.arpa
Address:  192.168.0.2
Aliases:  mqtt.home.arpa

When starting nslookup, the server name is correctly retrieved as raspberrypi.home.arpa. But when querying for that name, I get an incorrect reply.

Interestingly enough, a name such as mqtt.home.arpa which is a CNAME to raspberrypi.home.arpa is resolved correctly.

Likely not related, but noted in your debug log - you are using a deprecated setting:

-rw-rw-r-- 1 pihole root 147 Jul 14 13:15 /etc/pihole/pihole-FTL.conf
   REPLY_ADDR4=0.0.0.0

I did not set this, it must have been set by pihole itself (the file was created by pihole, I just added the first setting you mentioned and these were already there)

EDIT: maybe set by the following?

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