In that case, you are shadowing public DNS records with your Pi-hole.
To avoid unexpected resolution results, you'd have to supply all required DNS records, e.g. you'd see IPv6 addresses as returned by public DNS if you would not shadow AAAA
records for your domain. You can set those up via Pi-hole's Local DNS records simply by supplying an IPv6 address, or you could opt to regex block AAAA
replies, see Pi-hole extensions - Pi-hole documentation.
Other side effects may involve less obvious record types like MX
.
If you'd need those as well, you'd have to check how pihole-FTL
/dnsmasq
(Pi-hole's embedded DNS server) supports them, and apply them via a custom dnsmasq
configuration file.
You should also be aware that defining local CNAME records to point to a public domain won't work (as detailed on Pi-hole's CNAME screen), unless you'd shadow that domain in Pi-hole as well.
EDIT: Also, when using your Pi-hole from remote devices via VPN, shadowing public A/AAAA records with private IPs would preclude you from routing DNS requests only through your VPN, as the remote device would not be able to connect to your private range IP shadows. You should at least make your local devices accessible via VPN in that case.
I mentioned ping as inadequate as the failure output you've shared was from a ping command.
Some OS's ping implementations (notably, Windows ones) would fail to employ DNS for plain hostnames under unknown circumstances, i.e. they may never actually query your Pi-hole.
If that would have been the case, appending a dot to the hostname may have coerced ping to use a proper DNS lookup for resolution.
This may have contributed to your observation, as your router would likely propagate a different local domain (probably one of the mentions in my earlier reply), and clients would only use that domain to expand hostnames.
But as you've stated that you did configure your Pi-hole with local records for myserver
as well as myserver.mydomain.co.uk
, Pi-hole would have supplied the correct reply regardless, suggesting that your Pi-hole may have been by-passed.
You should check your router's DNS configuration settings to propagate only your Pi-hole host's IPv4 address as local DNS, and to disable propagation of local IPv6 DNS, or provide one of your Pi-hole host's stable IPv6 addresses.