HOWTO: Using pi-hole as LAN DNS server

Note: restarting dnsmasq didn’t seem to work for me, but pihole restartdns worked.

1 Like

I have found this to be simpler that the above. Simply edit the /etc/hosts file on the Pi-hole and put the IP and FQDN in.

The line in the man page for dsnmasq that gives a clue:

It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved

I now have a wildcard SSL certificate and multiple machines on my LAN happily serving over HTTPS. I do have to update the certificate onto each machine - I may look at a reverse proxy (or maybe not!)

An even easier solution is to put:


in the 01-pihole.conf file, which is what adding the router and domain under Settings>DNS does. If you have multiple domains, which we do, you can add an entry for each domain. We’re using Pi-Hole on three enterprise LANs (each of which uses MS Active Directory with DHCP and DNS) using this method and everything resolves just fine when looking up just the hostname.