Please follow the below template, it will help us to help you!
Expected Behaviour:
I am running Pi.hole on raspberry pi running ubuntu 22.04. I have some custom dns records (pihole.locusworks.net) that used to resolve perfectly fine and would expect it to continue to resolve local dns entries
Actual Behaviour:
Local DNS entries are no longer being resolved. When i run nslookup pihole.locusworks.net i get
Not directly related to your issue but whats your configured LAN search/suffix domain if run below?
sudo pihole-FTL dhcp-discover | grep domain-name
Is that the same as that public domain locusworks.net ?
If so, I would advice against that as some DNS queries, intended to be only resolved locally, could be unintentaly forwarded/leaked to your configured upstream public DNS servers.
Better use home.locusworks.net instead as a local search/suffix domain for your LAN.
Pi-hole has got below settings to prevent leaking those queries to upstream and your router probably does something similar:
I literally starting using pi-hole for the first time 10 minutes ago, but I was running in to the same problem and I think I found the solution, assuming you have the exact same issue, so here's my issue and how I fixed it.
I have a local dns server 10.1.10.10 that servers up addresses for my homelab (i.e. host.local.mydomain.com)
Pi-hole sends all requests to public servers, which of course wouldn't resolve those addresses.
To resolve this, I went to settings > DNS > Advanced DNS
Enable conditional fowarding
add this entry:
Local Network in CIDR: 10.0.0.0/8
DHCP Server: 10.1.10.10
local domain name: local.mydomain.com
It says DHCP server, but I think they are assuming that the DHCP server is also server up local DNS. Now any request that comes through for *.local.mydomain.com is sent to my DNS server, 10.1.10.10 and it resolves just fine.
I think it has something to do with my router. I have a Ubiquiti dream machine pro which is vlan'ed out (vlan 1 for the default and vlan100 for internal) my pihole sits on the vlan 1 while my internal devices sit on vlan 100. When i update my router settings i can briefly get dns resolution but then it starts failing again.
Yes thats the way.
It creates two DNS paths where only the lookups for local names are redirected via CF (Conditional Forwarding) to the DHCP service (in most cases the router) which knows of all the network clients that advertised their hostname to the DHCP service:
Client --> Pi-hole ----> Upstream configured DNS server(s)
|
--[CF]--> DHCP service that also does DNS
The settings from my previously posted screenshot will take care of those local queries never leaving your LAN.
But if the local LAN search/suffix domain is exactly the same as your public domain, these setting will also prevent clients from looking up that public domain (EDIT: and any public subdomains).
Thank you. I actually did two things. First i moved my pihole to be on the same subnet as my internal lan (100.x) and then set up the conditional forwarding. now everything is right as rain.