Problems resolving local hostnames

Dnsmasq looks at /etc/hosts for local domain hostnames, you will need to set them up there. You will want to include both the FQDN and the short name.

Example /etc/hosts (use whatever 'fake' domain you want in place of home.lan--Macs/bonjour/mdns uses .local, not sure how Windows handles it these days, so ymmv if you use .local)

10.10.10.254   router router.home.lan
10.10.10.X   tvpi tvpi.home.lan
10.10.10.X   campi campi.home.lan
...

You cannot configure dnsmasq to look at the router's host table--it's not designed to do that.

Also make sure your local domain is set in the dnsmasq configuration file, /etc/dnsmasq.d/01-pihole.conf:

domain=home.lan
expand-hosts
local=/home.lan/

More details here: dns - Using dnsmasq to address machines by name and resolve external hostnames - Super User
Dnsmasq For Easy LAN Name Services - Linux.com

As for your resolv.conf files, the 'tvpi' pi-hole system is set up to use the local dnsmasq (e.g. loopback address, 127.0.0.1) to resolve hostnames. If you ran the installation script and didn't over-ride the default settings, it now has a static IP and won't get any DHCP settings from the router. So having 127.0.0.1 is by design to prevent name resolution issues due to forwards going nowhere.

The other system, 'campi', is still receiving it's IP via DHCP from the router, so it's resolv.conf is set by the router. In my experience, most modern home routers always set themselves to the be the DNS server via DHCP, and short of installing 3rd party firmware, you can't over-ride that behavior.

If you are feeling adventurous, you could configure dnsmasq to handle DHCP and cut the router out of the equation entirely.

HTH--
=V=

1 Like