Research and Development
Use your PiHole as the DNS server for your LAN.
Create a second dnsmasq
configuration file:
echo "addn-hosts=/etc/pihole/lan.list" | sudo tee /etc/dnsmasq.d/02-lan.conf
Create a hosts file for your network: /etc/pihole/lan.list
with the following format: ipaddress fqdn hostname
, e.g.:
192.168.100.20 iroman.your.lan ironman
192.168.100.21 hulk.your.lan hulk
192.168.100.22 loki.your.lan loki
... substituting your.lan
with whatever you wish your domain name to be.
On your DHCP server (your router, or even more likely the PiHole), you’ll also need to set your search domain to whatever your.lan
corresponds to.
Finally, restart your name server:
sudo pihole restartdns