Traffic not routing through pi-hole

Please follow the below template, it will help us to help you!

Expected Behaviour:

I had it all working fine before changing IPs...(It's static now) When I set my DNS in my router to my pi's address my network's traffic should route through pi-hole. Tried using pi-hole's DHCP settings instead of the router with no luck either.

Actual Behaviour:

When I set DNS to pi-hole ip no devices can access the internet. When I set a secondary DNS server along side the pi internet access is retained, but the pi-hole dashboard shows no blocks and in the network page no devices are connected.

Debug Token:

5xqa2phomv

Welcome to the Pi-hole community, Edwin_Reik. :slight_smile:

Your debug log indicates problems with DNS resolution through Pi-hole's IP:

*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] api.vungle.akadns.net is 0.0.0.0 via localhost (127.0.0.1)
[✗] Failed to resolve api.vungle.akadns.net via Pi-hole (192.168.1.11)
[✓] doubleclick.com is 172.217.7.14 via a remote, public DNS server (8.8.8.8)

Is 192.168.1.11/24 the address you intend to use for Pi-hole?

As you claim to have recently changed that, let's check that against the static IP(s) that did get configured via dhcpcd:
What's the output of the following command when run on your Pi-hole machine?

 grep -v '^[[:blank:]]*#\|^[[:blank:]]*$' /etc/dhcpcd.conf

Thanks for the help.

pi@raspberrypi:~ $  grep -v '^[[:blank:]]*#\|^[[:blank:]]*$' /etc/dhcpcd.conf
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
interface wlan0
static routers=192.168.1.1
static domain_name_servers=127.0.0.1
static ip_address=192.168.1.11/24
static domain_search=
noipv6
interface eth0
static ip_address=192.168.1.11/24
static routers=192.168.1.1
static domain_name_servers=127.0.0.1
static domain_search=

I uninstalled openvpn server since my post, and i think im getting a different debug response. Just in case, here is my new debug token: https://tricorder.pi-hole.net/a0mflzakdl

You should decide which network interface (wlan0 or eth0) you want to use to assign a static IP of 192.168.1.11/24. Then delete the other lines by editing

sudo nano /etc/dhcpcd.conf

When done, notify dhcpcd of your configuration changes to apply them:

sudo dhcpcd --rebind

You can verify that your IP addresses are set correctly:

ip address show

Ok, the bottom of my .conf file reads:

noipv6

interface eth0
static ip_address=192.168.1.11/24
static routers=192.168.1.1
static domain_name_servers=127.0.0.1
static domain_search=

and ip address show:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:43:06:5d brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.11/24 brd 192.168.1.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::dea6:32ff:fe43:65d/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether dc:a6:32:43:06:5f brd ff:ff:ff:ff:ff:ff

Still, when i set my router primary DNS (no secondary address) to 192.168.1.11 I can't access the internet from any router-connected device.

FYI: I have a NETGEAR Nighthawk AC 1750 6700v3

Did you configure Pi-hole as your router’s
a) upstream DNS server (commonly a WAN/Internet setting),
b) local DNS server (commonly a DHCP setting)
c) both?

I entered it under Domain Name Server (DNS) Address in the image below.

I'm guessing I should be using the DHCP setting here in the image below?

We had other users reporting their Netgear router's as being not very cooperative when it comes to customising DNS. :frowning:

As for a), it seems you currently have not configured Pi-hole as your upstream DNS server yet (or no longer?).

If your router supports it, b) would be the preferred way.

However, your router's LAN Setup screenshot doesn't seem to expose any DNS related settings to be distributed by DHCP.

As your screenshots look similar to those of another recent user, you probably should check No internet connection when setting DNS through Netgear N300 router Firmware V1.1.2.18 - #16 by devinberg and see if disabling your router's DHCP server and using Pi-hole as both DHCP and DNS server would work for you as well.

It's strange though because the first time I installed everything worked effortlessly.

So, just to be clear, your suggestion is to leave my DNS setting as it is, and to uncheck the DHCP setting in my router, and check the DHCP setting in pihole?

Edit: I get this message when i try to disable DHCP

As your router does not seem to allow b) and seems to be interfering with or suppressing a):
Yes.

EDIT:
I do not know your router, so you'd have to consult your manual or online documentation on how to handle this.

As far as I can deduce from the screenshot, this is a reminder that IP addresses are no longer managed by the router (which is to be expected when you turn of DHCP)

Ok, done. The internet connect still works, but pihole still isn't blocking ads.

Your clients may still stick to their known old settings, until their current DHCP leases expire.

Have them disconnect or reconnect, either by switching WLAN / WiFi on and off, or by power-cycling them.

Still nothing from the pihole admin page. Nothing seems to be routing through still.

A new debug token would be appreciated.

No problem. Thanks again for the help.

https://tricorder.pi-hole.net/au5ph85vpi

There still is a problem with DNS via your Pi-hole's IP address.

From a client machine, what is the output of the following commands:

nslookup pi.hole
nslookup flurry.com @192.168.1.11

Server: 192.168.1.1
Address: 192.168.1.1#53

** server can't find pi.hole: NXDOMAIN

nslookup: couldn't get address for '@192.168.1.11': not found