Correct Resolv.conf entry in pihole 5.11

I had an issue running pihole -g yesterday due to an dns error.
The resolv.conf had this entry which is my router's IP.

Generated by resolvconf

nameserver 192.168.4.1
I changed the value to 127.0.0.1 and update went smooth.
What should be the correct entry, should it be the router ip or the loop back address or the external dns like the Opendns the pi's upstream address?

Choose whichever best meets your needs.

In previous versions of Pi-hole (V4.x and earlier), Pi-hole changed the name server for the host device to the loopback address, so the host device would use Pi-hole for DNS resolution. However, this caused problems when Pi-hole was offline or experiencing problems, and the host device could not connect to the internet for repairs or for uploading a debug log.

Starting with Pi-hole V5, Pi-hole no longer changes the name server of the host device. Whatever nameserver you set up for the device when you set up the OS remains unchanged by Pi-hole.

If you want the Pi-hole host to use Pi-hole for DNS resolution, change this to the loopback address. Otherwise, I would recommend using a third party DNS (like OpenDNS, if that is your choice) for the name server for the device. This takes any local DNS servers out of the loop and generally simplifies troubleshooting. My recommendation would be to use a different DNS server than you are using for Pi-hole upstream; this eliminates the single failure of that DNS server from disabling your Pi-hole and preventing troubleshooting.

Your Pi-hole host likely was assigned the router IP on setup via the DHCP process from the router.

3 Likes