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:

server=/your.domain/your_dhcp_or_dns_address

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.

Hi

Hos does option 2 work? Which settings should i use?

My router is currently using pi hole as dns and pi Hole uses cloudflared (dns over https)

5 posts were split to a new topic: Local Domain configuration ideas

This feature is called "Conditional Forwarding".

I'm trying to setup a LANCache server on my Pi, to do so I need to forward the IP addresses of the normally-external download servers to an internal IP. How should I do this using the configuration file? I've found a blog post that suggests using the syntax address=/<external_address>/<internal_IP> - is this advisable?

if you want to use pihole and lancache together i'd recommend just

  1. make pihole your primary dns server

  2. point piholes upstream dns server to lancache

  3. configure lancache as needed

this should work since all pihole is doing is black listing domains and gets a-records from upstream

I'm new to Pi-hole.

I have a similar file called /etc/pihole/local.list which has the two local names for pihole and the respective addresses. Silly question but could I put my local hostnames and their respective addresses in this file?

Does the new Pi-Hole 5.0 replace this HOWTO? I see there is a new function in the web GUI called Local DNS Records. I suspect that Pi-Hole 5.0 still works with the steps from this HOWTO applied.