Hello all, I am using Pi-Hole and it is fully up to date and seems to be working well except for the fact nothing is reachable via name on my network and it's bothering the hell out of me. The only thing that works, is "pi.hole" - which I don't understand, because I have all of the other devices also included in my /etc/hosts but it's completely being ignored
Here is the contents of /etc/hosts yet zero of these work when trying to reach them via their names, only reachable via IP address, except of course for "pi.hole" which works great.
Hrm, it gets weirder. dig and nslookup are responding with a valid result yet anything else (ping, curl, web browsing) it won't resolve suddenly? What a bizarre problem!
Your dig and nslookup results prove that your Pi-hole is correctly serving replies as defined in your /etc/hosts.
This strongly suggests that your issue lies outside of DNS.
Note that ping employs additional means to resolve hostnames, not just DNS.
Appending .local may have worked in the presence of proper mDNS support, i.e. if both your machine hosting Pi-hole and the machine named homeassistant would have been running mDNS client software.
In order to coerce ping to use a DNS lookup, you could try appending a dot straight after the hostname, or your local/search domain (which could be home, as one of your screenshots suggests?), e.g. homeassistant. or homeassistent.home.
There are probably ways to configure your OS for a certain order of precendence for plain hostname lookups - the exact details would be specific to your OS, so you should consider to reach out to their respective documentation and support.
Hi Bucking_Horn and thanks for getting back to me.
Unfortunately I have had no success with any of the above; even though dig/nslookup are responding correctly and still ping/curl/etc. are not.. I tried both homeassistant. and homeassistant.home in addition to just homeassistant and homeassistant.local all with no luck unfortunately
The same failed ping also successfully blocks flurry.com which is my go-to test for Pi-Hole functionality, so this is extremely bizarre
If you can think of any other possibilities please do let me know any time, I have subscribed to this post as I am hopeful someone in the future might either have this problem, or know how to fix it (or both!)
I'm not completely sure but I think the Authoritative Answer flag being set in the first dig response is indicating that the Home Assistant itself is involved in the DNS resolution here, and is therefore responsible for the inconsistent behaviour you are seeing.
What do you see when running dig on other hosts in your /etc/hosts? Do they resolve as expected and are they missing that flag?
What is the full output of the command
dig txt chaos version.bind
(If you can copy and paste the text from the terminal, that's better than a screenshot as it's searchable and editable. You can select it all in your post and click the </> icon and it will be formatted nicely.)
@sub_zero, 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
I doubt that, as Pi-hole would be expected to set that for domains it's authoritative for, which would include the domains from the local hosts file.
You're right – I tested it before posting and was only getting aa on the custom pihole domain I use and not the other custom domains. However I didn't spot that the others were in fact not resolving anyway because I wasn't using the domain suffix. When I do, of course it resolves and shows as authoritative.
However if Home Assistant is usurping the DNS in some way (maybe some helper application running locally, I don't know how it works), and it likely has the same hostname set, that might explain its own hostname resolving but not the hosts entries, since they are not seen. The txt dig should reveal if something like that is going on.
[root@arch ~]# dig txt chaos version.bind
; <<>> DiG 9.18.19 <<>> txt chaos version.bind
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41054
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;version.bind. CH TXT
;; ANSWER SECTION:
version.bind. 0 CH TXT "dnsmasq-pi-hole-v2.89-9461807"
;; Query time: 0 msec
;; SERVER: 192.168.1.3#53(192.168.1.3) (UDP)
;; WHEN: Fri Nov 03 10:13:25 EDT 2023
;; MSG SIZE rcvd: 83
[root@arch ~]# ping homeassistant
ping: homeassistant: Name or service not known
[root@arch ~]# ping homeassistant.
ping: homeassistant.: Name or service not known
[root@arch ~]# ping homeassistant.home
ping: homeassistant.home: Name or service not known
[root@arch ~]# ping homeassistant.local
ping: homeassistant.local: Temporary failure in name resolution
[root@arch ~]#
Lastly, and even more frustratingly, I attempted to ping by hostname on other computers on my network, and it works! Just for some reason not in my arch installation. For example all of the output you see above with the failures to resolve etc. are on my Arch machine, which is my Linux workstation. Yet if I enter the console on any of my other devices, or even here in Windows 11, I can suddenly ping "homeassistant" (or "homeassistant." in Windows) and it DOES work!
Theres no oddities in /etc/resolv.conf, it simply contains the correct Pi-Hole server IP that other machines are using with no problems. This is one heck of a strange problem
For the reasons already mentioned, you should not use ping to test for DNS operations.
Use dig or nslookup to do so.
Also note that if your ping would fail, that would not necessarily indicate a DNS resolution issue.
This reinforces my earlier statement that your issue is not with Pi-hole or DNS.
Also, your OS's name resolver should already read and use entries from /etc/hosts/ straight away, even without any DNS resolver like Pi-hole running.
This is a strong indication of your host OS name resolution configuration is faulty.
You may want to check your nsswitch as well as systemd-resolve configuration files.
You should consider to consult the Arch Linux forums for further support.
I never fixed the problem yet but Pi Hole has been great and I appreciate you getting back to me - I just made a donation and am considering making it recurring, thanks again