Hello community.
I have started using pi-hole as my local DNS. I have a router, which acts as DHCP server for several VLANs, and I want to keep it this way (don't want DHCP by pi-hole). Router also assigns the search domain to all clients (example.com).
For my some of my local hosts, servers, etc. I have static IPs assigned. For these, I have created a conf file in /etc/dnsmasq.d/ directory, which contains a list of --host-record directives, e.g.:
--host-record=ilo,ilo.example.com,10.201.25.2
--host-record=xcpng,xcpng.example.com,10.201.25.3
--host-record=syno412,syno412.example.com,10.201.25.5
I have also defined 2 other hosts through GUI's local DNS option:
hostA.example.com 10.201.22.20
hostB.example.com 10.201.22.21
pi-hole is the only DNS server assigned to all DHCP clients.
Expected Behaviour:
All clients should be able to resolve names from either --host-records or LocalDNS as local IP addresses.
Actual Behaviour:
The expected behaviour works for some time.
After certain time when I try to resolve hosts from --host-record list, pi-hole does not return internal IPs, but queries external DNS servers and returns my public IP (returning external IP in this case is correct considering that external DNS servers are asked, as they are configured this way, but this behaviour of pi-hole is not desired/expected).
If I query HostA or HostB, I get correctly the local IPs.
If I play around in GUI (probably triggering some reload) or if I simply restart the DNS service via GUI, then I get again correct resolution to local IPs also for --host-records for some time.
So to me it looks like the --host-records time-out after some period and pi-hole forgets them unless reloaded.
If it matters:
- Interface options = permit all origins
- Never forward non-FQDN
A
andAAAA
queries = checked (useless[?] since clients have search domain assigned?) - Never forward reverse lookups for private IP ranges = checked
- Use DNSSEC = unchecked
- DHCP server = disabled
The behaviour has been confirmed from various clients, i.e. not only my laptop, but also other VMs and hosts cannot resolve local names provided via host-record after some time.
Debug Token:
I would have included the token, but the script has been hanging on this line for the last hour:
-rw-r--r-- 1 root root 12M Dec 22 00:00 /etc/dnsmasq.d/dnsmasq.adlist.conf
But given that the bash is utilising the CPU the most, maybe it is still doing something. I let it run a bit longer and if it finishes, I'll post the token.