So nss is out of the picture. Good to know.
I'm running pihole in a container too. I'm forwarding requests from my local LAN to my router whichs also serving DHCP and DNS. The queries for all the hosts on my network get forwarded to my router and work well, but pihole's FQDN (pi.beeb.at) gets resolved to 127.0.0.1. wipi is a cname
Lookups
pi.hole
# lookup
NAME TYPE CLASS TTL ADDRESS NAMESERVER TIME TAKEN
pi.hole. A IN 0s 10.0.0.2 10.0.0.2:53 5ms
# log
00:32:25: query[A] pi.hole from 10.0.1.1
00:39:05: Pi-hole hostname pi.hole is 10.0.0.2
pi.beeb.at (FQDN via DHCP)
# lookup
NAME TYPE CLASS TTL ADDRESS NAMESERVER TIME TAKEN
pi.beeb.at. A IN 0s 127.0.1.1 10.0.0.2:53 5ms
# log
00:37:40: query[A] pi.beeb.at from 10.0.1.1
00:37:40: /etc/hosts pi.beeb.at is 127.0.1.1
Config
docker run
sudo podman run -d \
-p 80:80 \
-p 53:53/tcp \
-p 53:53/udp \
-v pihole:/etc/pihole \
-v dnsmasq:/etc/dnsmasq.d \
-e TZ=Europe/Vienna \
-e WEBPASSWORD=REDACTED \
-e FTLCONF_local_ipv4=10.0.0.2 \
-e DNSMASQ_LISTENING=all \
--restart=unless-stopped \
--name=pihole \
pihole/pihole
pihole -d
https://tricorder.pi-hole.net/RNVj2eFM/
hosts
Inside container
27.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 pi wipi
10.88.0.1 host.containers.internal
10.88.0.24 1ef2dd547223 pihole
Host
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 pi wipi