Discussion in 'Linux & Open Source' started by NoNameNoNumber, Nov 5, 2016.
AHH my fault then as I was putting it in Local.list
I see V5 of Pi-hole has been released with fairly big changes, the scripts I have to copy adlists.list, blacklist.txt, whitelist.txt etc won't work any more.
I'm just installing it on a spare Pi Zero to see how easy it's going to be to migrate my other two Pi-holes.
Yeah gone over to database for adlists/whitelists/blacklists in sure someone will come up with a sync tool/script at some point.
I'm planning to look at the DB side of things when I can, it should be easy enough to script an export from one DB and an import into another. No idea when I'll get around to it, but if I get it working I'll post the script up here.
Oh wow - Looks like my Piholes have been using cached block lists for some months and I hadn't realised because they basically run without any involvement from me. I've used the teleporter to move things over and my number of blocked domains has dropped by about three quarters!
Yeah, most of the custom block lists I'd added have disappeared.
Got an annoying issue with my setup.
I opted for the route of just setting the DNS on the router back to the pi-hole. This unfortunately means from the pi-hole perspective, all the traffic is coming from the router - which is expected. But does mean that i don't get a per-client view of what devices are making the most requests/getting the most blocks etc.
For about half of the devices on my network i could manually set the DNS from the device, but the other half don't have the ability to set static IPs/DNS and would rely on the router to dish out that information.
Has everyone else who sets the DNS on the router just lives with a single client reporting? I'm not even sure if having a hosts file on the pihole would make much difference as the traffic goes to the router first and then bounces back to the pihole for DNS, so the pihole still wouldn't see the client IP?
Hosts table on the Pi-Hole won't help as the source of the traffic hitting the Pi-Hole will still be your router.
Why are you doing it that way? Could you not change the DHCP settings on your router and tell it to dish out the Pi-Hole instance as the DNS server? I'm guessing your router won't let you change the DNS server? If that's the case can you disable DHCP on the router and use the DHCP server that's built into Pi-Hole?
That is currently the way it's doing it
I will try setting the pihole as the DHCP server and see if it works that way.
So your router won't let you change the DNS server in the DHCP settings? What a pain.
I can change the DNS server in the DHCP settings on the router, but it results in the same issue you described if i were to use a hosts file on the pihole. All traffic is redirected by the router which means that you don't get a per-device view.
Using the pihole as a DHCP server may work around this issue but i guess would still depend if the traffic is routed to it from the router first.
Ptth, I don't like it when kit does that. So despite you changing the DHCP server settings the router will still be dishing out itself as the DNS server and then relaying requests from clients to your Pi-Hole instance.
Setting Pi-Hole as the DHCP server will definitely work. If you disable DHCP on the router and enable it on Pi-Hole there will only be one place that clients can get IP addresses from - the Pi-Hole instance. Depending on the physical setup you have, the DHCP traffic will probably still physically go through the switching fabric on the router but the router won't be offering out DHCP leases.
Oh they've been added back via the teleporter but because I've started with a fresh build, the lists that were cached on the old one have gone. I didn't have a huge number of additions but it'd be nice to get back to roughly how I was before.
Ah just discovered something interesting. So most of my devices have either static IP or manually set IP from the router - i prefer to know which IP all my devices are, so that if something gets a DHCP IP then i know it's not mine, unless i'm plugging something new in and aware of it.
Anyway, one of my new devices just got dished out a DHCP address and does report to pihole correctly as an individual device. But my manually set IP's or static IP's go directly to the router for DNS which then gets relayed to pihole.
From what you've said it sounds like DHCP on the router is actually giving out Pi-Hole as the DNS server rather than itself and then relaying the requests.
On the static devices, double check the DNS server you've set. I guess you've set the router rather than Pi-Hole or maybe you've got router and Pi-Hole set. Remove what's there and put just the IP address of the Pi-Hole box, don't have Pi-Hole and the router listed.
My ISP router doesn't let me set a DNS server in DHCP settings either so I have everything coming through as my router too. Been looking at getting a third-party with that capability and also to be able to specify a secondary DNS. Since I have pihole hosted in a VM I'm unsure about having it set as the DHCP server in case the VM needs restarted or the server hosting it is off.
I wouldn't have any concerns about running DHCP on a VM. It isn't as if when you reboot the VM or hypervisor all the clients lose their IP address. Worst case if the VM is down you might need to temporarily set a static IP on something.
If you're going to add a secondary DNS server, make sure that's also a Pi-Hole instance. Contrary to popular belief, clients don't only send queries to the secondary DNS server if the primary is down so if you want Pi-Hole to be used exclusively then all your DNS resolvers need to be Pi-Hole.
Just set a static IP on host and VM
Separate names with a comma.