Add custom DNS entries to Pi-Hole

Pi-Hole is the black hole for the internet. As of the most recent Pi-hole Version v2.13.2 with Web Interface Version v2.5.2, a local network should have the necessary tools, DNS and DHCP servers, to run successfully.

With that said, what if you want custom DNS settings? I tried this approach successfully, so now one IP resolves to several domain names. The following was completed as root user.

echo "addn-hosts=/etc/pihole/lan.list" | tee -a /etc/dnsmasq.d/02-lan.conf

Add IPs and names to a host file.

echo '192.168.1.100  test.example.com my.example.com my.server.home' | tee -a /etc/pihole/lan.list

Restart the DNSMasq Server.  I used the web interface.  However, the following command should do.

#service dnsmasq force-reload
sudo pihole restartdns

Now, the fqdn server names should all resolve to the IP address identified in the lan.list file.

Source(s)

  • https://discourse.pi-hole.net/t/howto-using-pi-hole-as-lan-dns-server/533