Local hostname resolution with pihole

Hello all,

I have 2 setups of pihole on 2 different LANs at 2 properties.
Both are running pihole 5.1.2 - one on a raspberry pi 4 ( Raspbian buster) and the other on an old laptop (ubuntu 18.04)
both setups have pivpn installed also and are configured identically with regards to pihole settings and dnsmasq settings.

on the raspbian system i can access a local device using http://hostname/ , which resolves correctly.
However if i VPN into the network with the ubuntu server, running http://hostname/ does not resolve, however http://hostname.lan and http://hostname.local both resolve correctly.

the same issue occurs if i attempt to ssh into the server on the VPN connection - hostname does not resolve but hostname.local or hostname.lan does resolve

If i perform an nslookup i get correct resolution for the local ip of hostname and hostname.local - same results when i run the lookup directly on the servers themselves

I have the devices configured in the /etc/hosts file to their hostnames and hostname.lan

i can also access devices on the local network that are not in the hosts file by only their hostname i.e. http://hostname2/

I have flushed dns after connecting to the VPN and the only DNS server is the pihole on the VPN still with the same results.

does anyone know why hostname alone only resolves on one network but not on the other?

thanks

Name resolution for *.local may be provided by mDNS (as implemented e.g. by Apple's bonjour or Linux' avahi), so I would discard those from your investigation.
For the same reason, it's advisable to pick anything but .local as your local domain (also dubbed search domain or search suffix).

To better understand your issue, it may help to see the exact statements and their outputs for failure as well as for success on your Ubuntu-LAN.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.