Pi-hole hostname resolves to 127.0.1.1 from a client

First, it is Windows' nslookup that expands your hostname from ph5a to ph5a.dehakkelaar.nl by attaching your local search suffix dehakkelaar.nl.

Judging by the information you supplied, the only available resolution then is 127.0.1.1 as found in /etc/hosts, so it seems Pi-hole provides the correct answer.
Removing that line from your /etc/hosts should resolve your issue.

I have also checked all of my Pi-hole instances, and none of them contains any FQDN for the local hostname in /etc/hosts.
Changing the local hostname via hostnamectl or raspi-config did not alter /etc/hosts, and neither did a follow-up pihole -r.

This gives rise to the question how those local hostname definitions (and especially the FQDN) would have made it into your hosts file?

1 Like