IP/Host association


#1

If you’re not using pihole as you dhcp server, all you get is host IP addresses as far as identification goes. I was already aware that would happen.

However, is there a reason the admin page couldn’t allow you to associate an IP with a host name? My router is my DHCP server, and it allows me to reserve an IP for a specified MAC address, so allowing a manually specified association in PiHole’s admin page is perfectly reasonable.


#2

This is done in the /etc/hosts file of the Pi. With an editor, add lines for each of your local clients. Format is one client per line, IP address followed by at least one space, then the client name with no spaces.

Here is an example:

pi@Pi-3B:~ $ cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1 Pi-3B
192.168.0.102 Printer
192.168.0.110 SmartThings-hub

#3

Ahhh - many thanks.