I don't know if what I'm looking to do is possible. I've read the Pi-Hole sticky post and a number of other Pi-Hole related posts but am not finding a solution.
If I set up my DNS as described in sticky example 1, clients then hit the Pi-Hole directly for DNS and I can see them in the Pi-Hole logs. This allows easy troubleshooting if I've got something that I think the Pi-Hole is blocking as I can filter records to just the testing client. Problem with this is local hosts that get DHCP from DD-WRT no longer resolve by host name.
If I set up my DNS as described in sticky exmaple 2, local host names do resolve and the clients do still ultimately use the Pi-Hole for DNS, but by the proxy of DD-WRT. As such all Pi-Hole log entries show as coming from DD-WRT as the host, making troubleshooting/tracking of Pi-Hole use difficult.
Is there a way to get the best of both worlds? Where clients would hit the Pi-Hole directly for DNS but local host names would still resolve? Is there something obvious I'm missing? Is there something advanced that I just don't know of/how to use that can solve this?
Last edited by Pow on Sun Jan 30, 2022 19:21; edited 1 time in total
I don't use pihole, so I don't know if this is possible. But if it's like DNSMasq, perhaps it's capable of forwarding DNS requests to a specific domain to another DNS server.
Posted: Tue Jan 25, 2022 9:19 Post subject: Re: Pi-Hole contacted directly for DNS, but DD-WRT backup?
Pow wrote:
If I set up my DNS as described in sticky example 1, clients then hit the Pi-Hole directly for DNS and I can see them in the Pi-Hole logs. This allows easy troubleshooting if I've got something that I think the Pi-Hole is blocking as I can filter records to just the testing client. Problem with this is local hosts that get DHCP from DD-WRT no longer resolve by host name
Local DNS entries can also be added directly in the Pi-Hole. (of course this only makes sense for static addresses)
See screenshot
with regard to the 2nd example...
Well, actually it doesn't make the pi-hole usage more difficult - and strictly speaking the sorting by individual clients is just a nice gimmick - once the pi-hole is set up it runs in the background.
Here sometimes weeks and months go by without me opening the WebIF.
Last edited by ho1Aetoo on Tue Jan 25, 2022 14:18; edited 1 time in total
Is there a way to get the best of both worlds? Where clients would hit the Pi-Hole directly for DNS but local host names would still resolve? Is there something obvious I'm missing? Is there something advanced that I just don't know of/how to use that can solve this?
I have this configuration and use local domains in pi with DHCP running on router, i am pretty sure i had to add the below example
Code:
address=/samsungprinter.lan/192.168.x.x
into my dnsmasq.custom file on router and use http in browser http://samsungprinter.lan
as well as entering them into the pi local dns records
i am no expert hope this helps _________________ Netgear R7800 PPPoE Main Router
Network IPV4 - Isolated Vlan's with IoT Devices. Unifi AC-Pro x 3 AP's, Router Wi-Fi Disabled. OVPN Server With Paid Commercial Wireguard Client's. Gateway Mode, DNSMasq, Static Leases & DHCP, Pi-Hole DNS & Running Unbound.
No one can build you the bridge on which you, and only you, must cross the river of life!
Is there a way to get the best of both worlds? Where clients would hit the Pi-Hole directly for DNS but local host names would still resolve? Is there something obvious I'm missing? Is there something advanced that I just don't know of/how to use that can solve this?
i only had a quick look at thread didn't read it all (mybad), i was at work, i had the same issue as the OP originally, i am sure i had to add e.g address=/samsungprinter.lan/192.168.x.x to dnsmasq.custom and it worked, (and it didn't prior to adding), obviously with the entries in the pi as well but i will check when i am home, it just works i never touch it. lol
it may not require this adding, i did state i am not an expert just trying to help. if this info is wrong i apologise, i always update this file but it may not be required. if required i will test your option eibgrad and confirm. _________________ Netgear R7800 PPPoE Main Router
Network IPV4 - Isolated Vlan's with IoT Devices. Unifi AC-Pro x 3 AP's, Router Wi-Fi Disabled. OVPN Server With Paid Commercial Wireguard Client's. Gateway Mode, DNSMasq, Static Leases & DHCP, Pi-Hole DNS & Running Unbound.
No one can build you the bridge on which you, and only you, must cross the river of life!
Whether you need to add address directives to create DNS records for some of your devices in DNSMasq is a separate issue than how to gain access to those DNS records when you've reconfigured all your LAN clients to use the pihole exclusively.
If we assume you decide to add those DNS records to DNSMasq, then that was the point of my suggestion. I'm wondering if (like DNSMasq) the pihole has the ability to direct references to the router's domain (e.g., lan) back to DNSMasq for resolution.
The other option (obviously) is to define all your DNS records on the pihole. But that will NOT provide you with any information regarding DHCP clients that have no such DNS records.
On a side note, I find the host-record directive to be superior to the address directive for creating DNS records in DNSMasq. The former also supports reverse lookups (i.e., the ability to provide an IP address and have it report the hostname). That can come in handy sometimes.
Code:
host-record=mypc,192.168.1.100
Also, whenever I created address or host-record directives, I always include the hostname *and* fully-qualified hostname.
POW please ignore my previous posts adding to the dnsmasq.custom file is not required.
Tested, ho1Aetoo is correct, no entries are required in router dnsmasq file, i had to add these when i first started using my pi to get local domains to resolve, but i must have changed the configuration some time ago, it works by just entering the local domain in to the pi as ho1Aetoo said.
i have now removed my entries from dnsmasq.custom thanks ho1Aetoo this saves me a job updating that file when its not required. _________________ Netgear R7800 PPPoE Main Router
Network IPV4 - Isolated Vlan's with IoT Devices. Unifi AC-Pro x 3 AP's, Router Wi-Fi Disabled. OVPN Server With Paid Commercial Wireguard Client's. Gateway Mode, DNSMasq, Static Leases & DHCP, Pi-Hole DNS & Running Unbound.
No one can build you the bridge on which you, and only you, must cross the river of life!
So it looks like my best option if I want the Pi-Hole logs to be meaningful is to go with sticky thread option 1, and manually maintain DNS entries for local network hosts in the Pi-Hole? Do I have that right?
I was sort of hoping that there would be something along the lines of DD-WRT handing out the Pi-Hole IP for DNS when it assigns DHCP leases, then the Pi-Hole in addition to looking at internet servers for DNS resolution could also look to DD-WRT for local hosts if they were not found in the first lookup. Which I guess would be partially a question for the Pi-Hole community, but I'd also need to know if DD-WRT would act as a DNS server for local hosts even if it was told to point DHCP clients to the Pi-Hole.
I've been using sticky option 2 since I set up my Pi-Hole, but it would really be nice if in the Pi-Hole I could see logged domain lookup attempts by individual clients rather than everything just being my DD-WRT router address. I'm assuming I could somehow set up same DNS lookup logging within DD-WRT but why double the effort when the Pi-Hole is already doing it?
Thanks for the feedback all, it is appreciated. Heck, I'm already ahead of the game since before I opened this question I first updated DD-WRT to a more current version to make sure I wasn't missing anything. Once I did that I discovered that it now actually has a working sftp server. Something I lacked on my old version, without jumping through a few hoops first. The way I maintain reconfiguring DD-WRT after an update is simplified with this available.
i use the 2nd method posted by ho1Aetoo using dnsmasq on router and run unbound on pi, just works never seem to need to touch it other than any updates.
i get to see hostnames in DHCP lease clients list Status>LAN. _________________ Netgear R7800 PPPoE Main Router
Network IPV4 - Isolated Vlan's with IoT Devices. Unifi AC-Pro x 3 AP's, Router Wi-Fi Disabled. OVPN Server With Paid Commercial Wireguard Client's. Gateway Mode, DNSMasq, Static Leases & DHCP, Pi-Hole DNS & Running Unbound.
No one can build you the bridge on which you, and only you, must cross the river of life!
Sorry, just saw the reply yesterday and was waiting for the weekend to try it. Just did so, and it seemed like the PiHole was having trouble getting DNS from the router, or the router wasn't relaying that out to the internet.
But I may have stumbled on something, I'm going to tinker with it. Stay tuned...