Localhost Querying Pihole domain?

I was able to finally resolve this issue by changing the hosts files line for localhost to match the hostname entry as mentioned in this article

https://www.vultr.com/docs/how-to-change-your-hostname-on-debian

Since the default build uses the hostname file and puts in PiHole you have to edit the first line of the hosts file from localhost to pihole and then OS quits trying to resolve pihole.

Probably wasn't eating up too many resources but i hate little inefficiencies like this.

1 Like

This also worked for me tooo THanks!
image

Last night (02/15/2022) one of my piholes was updated to v5.9 FTL v5.14 and web interface v5.11 and since then dnsmasq was flooded with A and AAAA queries for the host name, one per second!
After searching I found this page and applying this fix resolved my problem!
Writing this comment so that if others run in to it after an update they can give this a shot.

1 Like

This fixed it for me too. My hosts file looks like this on ubuntu 20.04.3 Server:

I only changed: "127.0.0.1 localhost" to "127.0.0.1 ubuntu". Fixed it immediately.

===========START============
127.0.0.1 ubuntu

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
===========END============

Above line is necessary for the the localhost name to resolve to IPv4 127.0.0.1.
Dont change that one!

Below how is done for Pi-OS/Debian etc:

1 Like

Haha yeah, I put that back in a few minutes ago lol. DUHHH haha

Thanks.