Skip to main content

Pi.Hole DHCP Lease Conflict

Warning in dnsmasq core:
not giving name mediaputer.lan to the DHCP lease of because the name exists in /etc/hosts with address

I spent some time trying to figure out why this error kept appearing in my Pi.Hole logs. Everything otherwise seemed to be working. The "mediaputer.lan" device is the Pi 400 I use to run Pi.Hole and DHCP. It has a static IP address set by my main router: I tried editing /etc/hosts with that IP, then tried setting the same static IP address within Pi.Hole itself.

After seeking online solutions, I ran ip r | grep default.

The results showed something that perhaps a smarter individual would've already guessed:

default via dev eth0 src metric 202 
default via dev wlan0 proto dhcp src metric 303

The Pi is connected over Ethernet but still has wireless radio enabled and that wireless interface will get its own IP address. While wifi could be useful if the ethernet cable one day had an issue, that seems unlikely and it's also a problem I would want to notice and fix immediately. I believe it's good security practice to disable any unused radio signals, and the less wireless interference I create in my own home, the better.

So next I edited /boot/config.txt: sudo nano /boot/config.txt

Inserted these lines after [all]:

# lines below will disable wifi and bluetooth

And there we go, a reboot should be all we need! sudo shutdown -r

Well, it looks like that worked to shut down wifi as far as the Pi is concerned, but the message kept appearing in the log files of the Pi.Hole. The Pi computer itself is named mediaputer but the hostname of the Pi.Hole is pi.hole. I'm no network expert but I specialize in throwing spaghetti at the wall, so next I dove back into /etc/hosts: sudo nano /etc/hosts

The line at the top of the file is localhost, which is accurate—but then why does the bottom line have mapped to mediaputer, when mediaputer should be equal to localhost which is equal to So I guess you could say I had a hunch.

Let's instead map that to the pi.hole. Here's what the file looked like now:       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters       pi.hole

Rebooted, and so far there's no more error. There's a slight chance I could've been the one to incorrectly modify the hosts file in the past since I didn't see anyone else on the Internet with this particular solution, but at least it motivated me to create my first post.