Internet not working when I changed Router DNS to RPi(3b+) DNS

Expected Behaviour:

I did fresh install of pihole and I am new to it on raspberryPi 3b+ using wlan0 interface for DNS queries. After setting everything up with static IP process and all that, now I changed my router's manual DNS to my raspberrypi's DNS and restarted both. As I did it Internet should work on other devices connected to same network via router.

Actual Behaviour:

As soon router gets running with pihole DNS nothing works. No internet connection on other connected devices including raspberrypi's own internet (I tried to ping google.com from RPi but got Temporary failure in name resolution).

To make internet work on RPI and upload debug file I changed sudo nano /etc/resolv.conf nameserver from 192.168.1.1 to 127.0.0.1
Now internet works only on RPi not on other devices and I can see from webinterface that queries from localhost (RPi) is getting logged.

  • when I do specific nslookup using pihole DNS from other device it works and gets logged in pihole web database but normal lookup or ping doesn't work.

example:
When I try to run following command from other computer connected to router it works:
nslookup google.com <IP of pihole RPi>

and this fails to execute:

nslookup google.com

Please help me to fix this problem as I have tried to reinstall pihole or reconfiguring lot of times, and ending up with same problem.

Thanks

Debug Token:

Public post of debug log removed by moderator.

Your debug log shows your Pi-hole to be operational.

Run from a client that you expect to use Pi-hole for DNS, what's the output of the following commands:

nslookup pi.hole
nslookup flurry.com

Please provide the full output, including the commands themselves.

Thanks for your quick response!

These are to queries that I triggered from client PC (Ubuntu 22.04)

1. nslookup pi.hole

result:

nslookup pi.hole
;; connection timed out; no servers could be reached

2. nslookup flurry.com

result:

nslookup flurry.com
;; connection timed out; no servers could be reached

However when I manually define nameserver on nslookup everything works

1. nslookup pi.hole ip_of_pihole

result:

nslookup pi.hole 192.168.1.9 
Server:         192.168.1.9
Address:        192.168.1.9#53

Name:   pi.hole
Address: 192.168.1.9
Name:   pi.hole
Address: fe80::6531:934d:fdbd:5cd6

and

2. nslookup flurry.com ip_of_pihole

result:

nslookup flurry.com 192.168.1.9
Server:         192.168.1.9
Address:        192.168.1.9#53

Name:   flurry.com
Address: 0.0.0.0
Name:   flurry.com
Address: ::

Please help me to find out what's wrong here. Thanks again.

What nameservers have you specified that the Ubuntu client use?

From the Ubuntu PC, output of the following?

cat /etc/resolv.conf

cat /etc/resolv.conf

output:

nameserver 127.0.0.53
options edns0 trust-ad
search .

This client is using itself for DNS. That is a loopback address.

That's ok, but it was supposed to work on other mobile devices and smart TVs connected to this network, but internet doesn't work on them either.

Your DHCP server (the router) is distributing its own IP for DNS, not the IP of your Pi-hole.

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   Timeout: 10 seconds
   
   * Received 320 bytes from wlan0:192.168.1.1
     Offered IP address: 192.168.1.10
     Server IP address: N/A
     Relay-agent IP address: N/A
     BOOTP server: (empty)
     BOOTP file: (empty)
     DHCP options:
      Message type: DHCPOFFER (2)
      server-identifier: 192.168.1.1
         lease-time: 86400 ( 1d )
      netmask: 255.255.255.0
      router: 192.168.1.1
      dns-server: 192.168.1.1
      netbios-ns: 192.168.1.1
      --- end of options ---
    
   * Received 300 bytes from wlan0:192.168.1.1
     DHCPOFFER XID (4245287889) does not match our DHCPDISCOVER XID (611996601) - ignoring packet (not for us)
   
   DHCP packets received on interface eth0: 0
   DHCP packets received on interface lo: 0
   DHCP packets received on interface wlan0: 1

Your Pi-hole is at 192.168.1.9

Thanks for your help, appreciated.

Do I need to disable my routers DHCP server to prevent this behaviour or is there anything else?

You need to change the router DHCP so that it provides the Pi-hole IP.

If you cannot do this on your router, then disable DHCP on the router and enable DHCP in Pi-hole.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.