I recently discovered Pi-hole through one of Linus' videos and thought I would give it a try. I downloaded VirtualBox and installed an Ubuntu minimal system, on top of which I installed Pi-hole. All my management is done on the host laptop, since i allocated 512 MB of RAM to the VM. I usually try to diagnose issues myself based on random forum posts, but this time I hit a brick wall. My Pi-hole simply refuses to block ads.
My router/ONT is from the ISP, and does not have an option to assign a custom DNS, so if I want to use Pi-hole, I need to manually assign it to each device in the house. Here are the steps I took:
even before installing Ubuntu minimal, I took the MAC address of the VM and went to my router properties, assigned a static IP address.
I installed Pi-hole with the default settings, basically "next, next, next, finish"
Went on the host computer and set the network adapter's preferred DNS the IP of the Pi-hole (although I don't think it's necessary because of next step). No secondary DNS set, so ads don't leak through.
Disabled my router's DHCP, I am using Pi-hole DHCP. All my devices appear under Currently active DHCP leases and all of them can access the Pi-hole GUI. I also checked Listen on all interfaces.
ipconfig /all correctly displays the DNS server and DHCP server. The default Gateway is my router's IP.
Results from nslookup pi.hole:
Server: UnKnown
Address: fe80::1
Non-authoritative answer:
Name: pi-hole.net
Addresses: 2604:a880:400:d0::1071:1
206.189.252.21
8. Restarted router and every device in the house.
9. Ran pihole -g -f from the client, I updated Gravity from the GUI as well.
10. Played a bit with some/all of the Upstream DNS Servers.
11. Did ipconfig /release, /flushdns, /renew
12. ubuntupit.comspeedtest.net and ads-blocker.com all show ads.
13. My debug token is: https://tricorder.pi-hole.net/nm6avpiqbh
I kinda ran out of ideas on what to try next, any help would be greatly appreciated.
From what device was this command run? From the Pi-hole host terminal, or from a different client on the network?
Your debug log shows that Pi-hole is working and that DNS queries have been received from 9 clients, and about 22% were blocked by Pi-hole. This shows that ads should be being blocked.
[2020-03-13 21:44:45.271 574] Imported 7335 queries from the long-term database
[2020-03-13 21:44:45.271 574] -> Total DNS queries: 7335
[2020-03-13 21:44:45.271 574] -> Cached DNS queries: 1275
[2020-03-13 21:44:45.271 574] -> Forwarded DNS queries: 3903
[2020-03-13 21:44:45.271 574] -> Exactly blocked DNS queries: 2157
[2020-03-13 21:44:45.272 574] -> Unknown DNS queries: 0
[2020-03-13 21:44:45.272 574] -> Unique domains: 804
[2020-03-13 21:44:45.272 574] -> Unique clients: 9
[2020-03-13 21:44:45.272 574] -> Known forward destinations: 9
What catches my eye is the 9 forward destinations, when you have only 1 upstream DNS selected. What is the output of these commands from the Pi-hole host terminal:
I think I got my terminology wrong. For example, at step 3 i mentioned "host computer", but I was referring to the laptop that hosts the VM. But in this case, it should be referred to as a client, since it gets the network seeting from the Pi-hole VM. Sorry for the misunderstanding. I will try to be more specific than "host" or "client"
To answer your question, I ran the command on the laptop.
Running it from the Ubuntu VM that has the Pi-hole:
It's not a question of IF the ads can be blocked. I know for a fact that they can. I disabled my browser based ad blocker to test Pi-hole. As soon as i re-enable it, ads get blocked. Besides, I also tried with a system-wide ad blocker (AdGuard) and it can block ads even in apps from the Windows Store. Additionally, I added entries in the host file from MoaAB (https://forum.xda-developers.com/showthread.php?t=1916098). Again, ads get blocked.
The biggest advantage of running Pi-hole and what sold me to it is that you can block ads on devices that don't support ad blocking, like smart TVs.