I'm using Pi-Hole (latest) to resolve local DNS entries (but not for DHCP). Local domain is .local
machine.local --- 192.168.1.45 is a host manually added to the local DNS entries in Pi-Hole
I created 99-network.conf in /etc/dnsmask.d containing
domain=local
expand-hosts
Expected Behaviour:
When pinging "machine" >> name "machine" is resolved
When pinging "machine.local" >> name is resolved
Actual Behaviour:
When pinging machine >> name is not resolved
When pinging machine.local >> name is resolved
Debug Token:
I don't think there is something wrong with Pi-Hole, so no debug needed.
I though Pi-Home is using dnsmasq but I realized that the dnsmasq is not even running when typing:
ps aux | grep dns
I'm using Ubuntu Release 21.10 with fresh installation of Pi-Hole
What should I do to achieve what I want?
This is not a good choice for a LAN domain name. The local domain is widely used by MDNS services such as Bonjour, etc. The latest RFC (I don't have the number handy) recommends home.arpa.
Is this the correct directory or do you have a typo?
Upload a token anyway, as this will show the devs your dnsmasq configuration and any other related logs.
Dnsmasq is embedded in pihole-FTL, and pihole-FTL will be shown as the running process on port 53 in lieu of dnsmasq.
You should heed jfb's advice:
You really shouldn't use local FQDNs as your local domain, as that is reserved for mDNS usage. You are potentially multiplying the amount of lookup traffic for name resolution, and you'll just confuse your clients and yourself.
At the same time, ping isn't adequate to analyse DNS issues, even when using hostnames, as it may try to resolve hostnames through a variety of sources (including but not limited to DNS and mDNS), while pinging IP addresses wouldn't involve name resolution at all.
In your case, you can't be sure whether ping has resolved machine.local via DNS or mDNS or some other means
Use nslookup or dig to analyse DNS issues instead.
ping's resolution behaviour may also be the source of your observation:
On some OSs, ping would sometimes fail to issue a DNS request for plain hostnames.
You could try to force ping to use DNS for name resolution by appending a dot to your hostname, e.g. ping machine.
No the ping was not the reason of my issue, I also tried nslookup.
But now the problem has been fixed, I replaced "local" with home, and added local=/home/ in the conf file
rebooted and it seems to work now