I upgraded to v6 recently and after fixing the problems I am left with 1 annoyance which I cannot solve. I use pihole local DNS to access my few servers.
They are added via web Local DNS records:
server1.lan 192.168.1.2
server2.lan 192.168.1.3
The problem is, the pihole is running on server2 and pihole returns address for this query as 0.0.0.0, see the example:
I think this is because hostname is set also to server2 so it return own host address (0.0.0.0). The problem is, if I do command from server1:
ssh server2.lan
it tries to connect to itself (server1) cause it resolves server2 as 0.0.0.0.
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:
But even though pihole-FTL/dnsmasq reads the resulting definitions from custom.list during startup, it is replying with 0.0.0.0:
Feb 26 08:52:09 dnsmasq[58]: using only locally-known addresses for lan
Feb 26 08:52:09 dnsmasq[58]: read /etc/hosts - 8 names
Feb 26 08:52:09 dnsmasq[58]: read /etc/pihole/hosts/custom.list - 8 names
Feb 26 08:52:13 dnsmasq[58]: query[A] rp3.lan from 192.168.1.8
Feb 26 08:52:13 dnsmasq[58]: Pi-hole hostname rp3.lan is 0.0.0.0
Run from your Pi-hole machine, what's the output of
rp3:~$ docker exec -it pihole cat /etc/hosts
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
#
127.0.1.1 rp3 rp3
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Watching this closely as I experience the same issue. I think I'd help if nsswitch were preferring dns over files, as my Pihole is using DHCP and I configured it to forward requests to my router.
So the own hostname in /etc/hosts is 127.0.1.1 (which is very common) and Pihole prefers (nsswitch) files over dns, so if I lookup Pihole's FQDN i get 127.0.0.1. (Lucky the pi.hole lookup returns the real IP).
Noteable difference to OP: I've an empty custom.list
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
This line is a leftover from testing. I should have removed that. But as the line is invalid, it's not impacting our issue. 10.0.0.2 is Pi-hole's ip, that it gets from DHCP
I did full clean start and it works there. I have no idea why.
I added my 5 custom list and 6 local hostnames and replaced with old docker. So it works now. If someone wants to investigate I can zip old and new etc-pihole folder for investigation.
I had what I think is the same problem: my pihole is set to resolve unknown domains from my router, and the router is configured to provide IP addresses various .lan hostnames. However after upgrading, the pihole was successfully resolving the IP form the router (as seen in the logs), but then replying with "0.0.0.0" to all requests.
I found the expert setting DNS > DNS domain settings > Pi-hole domain name, which was set to "lan". I cleared this, and the problem was resolved.