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.confnameserver 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.
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