Thanks for looking into this, and if this edge case is helpful in resolving a hidden issue, then I’m glad for that.
% cat /etc/hostname
dns-vm-1
% cat /etc/host.conf
multi on
% cat /etc/nsswitch.conf
# /etc/nsswitch.conf
# Example configuration of GNU Name Service Switch functionality.
# If you have the \`glibc-doc-reference' and \`info' packages installed, try:
# \`info libc "Name Service Switch"' for information about this file.
passwd: files
group: files
shadow: files
gshadow: files
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
Yes, as I mentioned, domain name and IP addresses have been sanitized for privacy here (but not in the pi-hole debug report sent to you).
Also, as I mentioned, if in /etc/pihole/pihole.toml, I change
domain = ""
to
domain = "example.com"
then my local IPs resolve to (for example)
happy-little-threadripper.example.com.example.com
For the record, the “public domain” that I use, is owned/registered by me, and is used exclusively on my LAN. Unfortunately, do to the extensive number of hosts with SSL certificates that the hosts employ, using generic lan domains is not an option.
My local DNS servers have authoritative DNS zones and reverse PTR zones (via bind9) for that domain that are not available on the internet, and pi-hole is not supposed to be an authoritative DNS server for any IP in my setup (including it’s own IP).
If pi-hole was properly non-authoritative as I have (attempted to) set it, then it would follow proper procedure to get it’s FQDN from (upstream) DNS (bind9). If things were working as they should, then pi-hole does a PTR lookup for the LAN IP 203.0.113.41, and bind9 replies with the correct FQDN dns-vm-1.example.com. That’s what happens when I do a reverse IP lookup for any (other) host on my LAN. Pi-hole follows proper procedure, and retrieves the correct FQDN.
The only time it fails, is if I do a reverse PTR lookup (anywhere on my LAN) for 203.0.113.41 and 203.0.113.41 replies (incorrectly, non FQDN): “dns-vm-1.” If I do a reverse PTR lookup for 203.0.113.41 and 203.0.113.42 (my other local DNS server) replies (correctly, w/ FQDN): “dns-vm-1.example.com”.
The same issue is on the other DNS server on my LAN (which has an identical setup). The only time it fails, is if I do a reverse PTR lookup (anywhere on my LAN) for 203.0.113.42 and 203.0.113.42 replies (incorrectly, non FQDN): “dns-vm-2.” If I do a reverse PTR lookup for 203.0.113.42 and 203.0.113.41 (my other local DNS server) replies (correctly, w/ FQDN): “dns-vm-2.example.com”.
In this edge case, Pi-hole is inserting itself where it does not need to.
As I mentioned, I have my hostname and domain name set properly (following all best practices) in /etc/hosts:
127.0.0.1 localhost
127.0.1.1 dns-vm-1.example.com dns-vm-1
203.0.113.41 dns-vm-1.example.com dns-vm-1
and /etc/hostname:
dns-vm-1
% hostname -f
dns-vm-1.example.com
% hostname -s
dns-vm-1
% hostname -d
example.com
% dnsdomainname
example.com
I have my upstream authoritative DNS servers set properly (following all best practices, I’ve been doing this and more for three decades, I’m old - insert graybeard meme, shakes fist into the air).
The issue is pi-hole not following proper DNS resolution practices in the case where pi-hole is intended to be a recursive / caching DNS server (no authoritative DNS responsibilities) employing an IP blacklist.
It’s cool that pi-hole has other features, like DHCP and authoritative DNS - but I employ it exclusively for it’s ad-blocking / malware-blocking (and caching) capabilities. In this case, it should not be getting in the middle of, and not properly handling the resolution of it’s own assigned IP.
Thank you for your consideration. I love pi-hole!