I've read lots of the posts on here (eg. How to handle DNS on Pi-hole, DHCP on router and also resolve local hostnames) and other places and I just can't work out how local DNS lookups are supposed to work. PiHole AD blocking and external DNS work fine.
It seems like we need a new option in the DNS settings for "Send non FQDN queries to" and a box so we can put in the IP of the DHCP server/Router.
My setup:
Router 192.168.0.1 is DHCP (I can't use PiHole as my router provides much more functionality)
PiHole 192.168.0.3 is given to all clients as DNS by Router DHCP
PiHole 192.168.0.3 is in DNS for WAN interface on Router
PiHole is running in a VMware vSphere 6.5 VM, OS is Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-80-generic x86_64)
Upstream DNS in PiHole is 127.0.0.1#5053 and 127.0.0.1#5054 which are configured for DNS over HTTPS to Cloudflare
NOT ticked - Never forward non-FQDNs
NOT ticked - Never forward reverse lookups for private IP ranges
NOT ticked - Use DNSSEC
IS Ticked - Use Conditional Forwarding
192.168.0.0/24 192.168.0.1
Local domain name empty (I don't have one and don't want one/shouldn't need one!)
Names of the local devices appear fine in Top Clients so local reverse DNS lookups work fine.
Actual Behaviour:
PiHole can't resolve any local machines, neither can network clients, however my Router can. I can't be adding them all the dns file or DNS Records as this is way too time consuming and they change sometimes, doing this defeats the whole point of DNS.
I tried setting Custom 2 to my router but this didn't work either. I have another PiHole running on a RPI2B which has same problem.
Also another strange issue with the DNS Records feature...
I have added PI2 as a DNS entry with IP 192.168.0.4 under Local DNS > DNS Records, however when I try to resolve it ping doesn't work but nslookup does:
ping pi2
Ping request could not find host pi2. Please check the name and try again.
nslookup
Default Server: pihole
Address: 192.168.0.3
pi2
Server: pihole
Address: 192.168.0.3
Name: pi2
Address: 192.168.0.4
ipconfig /all of pc pinging/nslookup from:
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.0.2(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : 18 August 2021 14:40:46
Lease Expires . . . . . . . . . . : 18 August 2021 16:10:46
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 192.168.0.3
NetBIOS over Tcpip. . . . . . . . : Enabled
This is strange isn't it? PiHole clearly knows about it!
/etc/dhcpcd.conf contains:
slaac private
interface ens160
static ip_address=192.168.0.3/24
static routers=192.168.0.1
static domain_name_servers=127.0.0.1
I've also tried changing domain_name_servers to the Router.
Debug Token:
https://tricorder.pi-hole.net/z7s4As8I/
You may see from the log, I've blocked access to Google DNS on my Router as I use DNS over HTTPS but this isn't anything to do with this issue.