DNS resolution

I'm having the same problem but when I checked my interface there is only one ip for IPv4

Please post the token generated by

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

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

Same problem here, after a reboot the nameserver in resolv.conf is set to 127.0.0.53
When I change it to 127.0.0.1 it works again, all DNS requests from my LAN resolve fine. It is only the dns from my pihole (ubuntu 18.04.4 LTS) machine that dont work.
But after a reboot or a pihole -up it changes to 127.0.0.53 again

debug token: betpjhgbd8

Not sure if this is related to issue from the OP.
But if you see 127.0.0.53 in resolv.conf, this is probably due to a network manager configuring its own DNS forwarder for caching.
Check which of below network manager(s) is/are active:

sudo service dhcpcd status

sudo service network-manager status

sudo service connman status

I use pi-hole as a dhcp server on my LAN.

@pi-hole:~$ sudo service dhcpcd status

[sudo] password for : 
● dhcpcd.service - LSB: IPv4 DHCP client with IPv4LL support
   Loaded: loaded (/etc/init.d/dhcpcd; generated)
   Active: active (running) since Thu 2020-05-21 10:24:53 CEST; 12h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1208 ExecStart=/etc/init.d/dhcpcd start (code=exited, status=0/SUCCESS)
    Tasks: 1 (limit: 2317)
   CGroup: /system.slice/dhcpcd.service
           └─1521 /sbin/dhcpcd

May 21 10:24:43 pi-hole dhcpcd[1267]: ens192: soliciting a DHCP lease
May 21 10:24:43 pi-hole dhcpcd[1267]: ens192: soliciting an IPv6 router
May 21 10:24:43 pi-hole dhcpcd[1267]: ens192: Router Advertisement from fe80::20c:29ff:fe90:8bbd
May 21 10:24:43 pi-hole dhcpcd[1267]: ens192: adding default route via fe80::20c:29ff:fe90:8bbd
May 21 10:24:43 pi-hole dhcpcd[1267]: ens192: soliciting a DHCPv6 lease
May 21 10:24:48 pi-hole dhcpcd[1267]: ens192: probing for an IPv4LL address
May 21 10:24:53 pi-hole dhcpcd[1267]: ens192: using IPv4LL address 169.254.50.27
May 21 10:24:53 pi-hole dhcpcd[1267]: ens192: adding route to 169.254.0.0/16
May 21 10:24:53 pi-hole dhcpcd[1267]: forked to background, child pid 1521
May 21 10:24:53 pi-hole systemd[1]: Started LSB: IPv4 DHCP client with IPv4LL support.
@pi-hole:~$ sudo service network-manager status
Unit network-manager.service could not be found.
@pi-hole:~$ sudo service connman status
Unit connman.service could not be found.

but my ens192 is having a fixed ip address:

@pi-hole:~$ ifconfig
ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.70  netmask 255.255.255.0  broadcast 192.168.1.255

Could be some other network manager that I dont know of.
Whats OS ?

hostnamectl | tail -3

Find where 127.0.0.53 is configured:

sudo grep 127.0.0.53 -R /etc

Yes its suppose to be static for Pi-hole:

pi@ph5:~ $ tail /etc/dhcpcd.conf
[..]
interface eth0
  static ip_address=10.0.0.4/24
  static routers=10.0.0.1
  static domain_name_servers=10.0.0.1

mark@pi-hole:~$ sudo grep 127.0.0.53 -R /etc
[sudo] password for mark:
/etc/resolv.conf:# 127.0.0.53 is the systemd-resolved stub resolver.
grep: /etc/systemd/system/timers.target.wants/snap-repair.timer: No such file or directory
grep: /etc/systemd/system/timers.target.wants/snapd.refresh.timer: No such file or directory
/etc/resolvconf/resolv.conf.d/head:# 127.0.0.53 is the systemd-resolved stub resolver.
mark@pi-hole:~$ hostnamectl | tail -3
Operating System: Ubuntu 18.04.4 LTS
Kernel: Linux 4.15.0-101-generic
Architecture: x86-64

I just added 127.0.0.1 to my /etc/network/interfaces and now it seems to work as dns-nameservers

Looks like systemd-resolved is the culprit.
Is she active ?

sudo systemctl status systemd-resolved

If so, can disable with below:

sudo systemctl disable systemd-resolved

sudo systemctl stop systemd-resolved

And run below to let dhcpcd configure resolv.conf:

sudo systemctl restart dhcpcd

And check:

cat /etc/resolv.conf

When dhcpcd is active dont use /etc/network/interfaces to alter settings, leave it default:

pi@ph5:~ $ cat  /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

Settings should be changed in below file:

Ps:

pi@ph5:~ $ apt show dhcpcd5
[..]
Description: DHCPv4, IPv6RA and DHCPv6 client with IPv4LL support
 dhcpcd is a one stop network management daemon which includes
  * RFC compliant DHCPv4 and DHCPv6 clients
  * DHCPv6 Prefix Delegation support
  * IPv4LL (aka ZeroConf) support
  * ARP address conflict resolution
  * Link carrier detection
  * Wireless SSID profiles
  * ARP ping profiles

I think you already acknowlegded as much, but just to be clear on this:
Note that Pi-hole's operation is (and always was) independent from any nameservers configured to be used by the machine it runs on

Pi-hole will be able to provide DNS resolution services for your network clients regardless of the name servers configured via resolv.conf (or any other way) on the machine its running. That is one of the reasons why Pi-hole 5.0 does not alter that file anymore (and also because this could and has interfered with updating or repairing Pi-hole when Pi-hole's own DNS resolution capabilities had indeed been compromised).

Since you are using Ubuntu Bionic Beaver, you should be aware that Netplan is used to manage network interfaces and hence DNS servers used (in fact, for some time since some Ubuntu 17 version).

You should be able to provide the DNS servers of your chosing by editing its .yaml configuration files, usually found at /etc/netplan, see e.g.

1 Like

Omg another one:

ifupdown
dhcpcd5
network-manger
connman
Netplan
systemd-resolved
resolvconf

And am probably missing a few others that mess with resolv.conf :wink:
But not Pi-hole anymore after v5 release :+1:

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