After the latest Ubuntu update maybe due to pihole installed in my system, the server fails to resolve address. I completely uninstalled pihole but the issue persists. I saw that in the latest Ubuntu versions netplan is used so I tried to configure the yaml file like that
network:
version: 2
renderer: networkd
ethernets:
eno1:
addresses:
- 192.168.5.20/32
gateway4: 192.168.5.1
nameservers:
search: [local]
addresses: [192.168.5.1]
I applied the configuration and in the system-resolve --status command, the proper configuration is applied. The dns server where is pointed is working as all of my devices/phones/nas/etc are working without an issue.
I tried edit after the /etc/systemd/resolved.conf but the issue persists. The only thing that temporary fixed the issue is modifying the /etc/resolved.conf still with the same dns server and there the addresses seems to resolve without problem. The problem is that in every restart the configuration is lost and is getting replaced by 127.0.0.1 and the system stops resolving addresses. Any help on how to completely maybe restore the network configuration without reinstalling everything?
After pkg -l dnsmasq i get :
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-================-=============-============-================================
un dnsmasq <none> <none> (no description available)
ii dnsmasq-base 2.80-1ubuntu1 amd64 Small caching DNS proxy and DHCP
un dnsmasq-base-lua <none> <none> (no description available)
After ls -al /etc/resolv.conf i get :
lrwxrwxrwx 1 root root 29 May 4 00:48 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
After cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 192.168.5.13
search local
After cat /etc/network/interfaces :
ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
After cat /etc/systemd/resolved.conf
:
# This file is part of systemd.
...
[Resolve]
DNS=192.168.5.1
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=yes
#DNSStubListener=yes
#ReadEtcHosts=yes
After the command system-resolve --status i get :
Global
LLMNR setting: no
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.5.1
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
after cat /etc/NetworkManager/NetworkManager.conf :
there's a blank line only displayed.
after sudo systemctl status systemd-resolved i get :
Systemd-resolved.service - Network Name Resolution
Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; ve
Active: active (running) since Sun 2019-07-28 15:39:52 CEST; 4h 44min ago
Docs: man:systemd-resolved.service(8)
https://www.freedesktop.org/wiki/Software/systemd/resolved
https://www.freedesktop.org/wiki/Software/systemd/writing-network
https://www.freedesktop.org/wiki/Software/systemd/writing-resolve
Main PID: 3349 (systemd-resolve)
Status: "Processing requests..."
Tasks: 1 (limit: 4915)
Memory: 2.4M
CGroup: /system.slice/systemd-resolved.service
└─3349 /lib/systemd/systemd-resolved
Jul 28 15:39:51 plex systemd[1]: Starting Network Name Resolution...
Jul 28 15:39:52 plex systemd-resolved[3349]: Positive Trust Anchors:
Jul 28 15:39:52 plex systemd-resolved[3349]: . IN DS 19036 8 2 49aac11d7b6f6
Jul 28 15:39:52 plex systemd-resolved[3349]: . IN DS 20326 8 2 e06d44b80b8f1
Jul 28 15:39:52 plex systemd-resolved[3349]: Negative trust anchors: 10.in-a
Jul 28 15:39:52 plex systemd-resolved[3349]: Using system hostname 'plex'.
Jul 28 15:39:52 plex systemd[1]: Started Network Name Resolution.
and yes after reboot it changes to 127.0.0.1
cat /run/systemd/resolve/resolv.conf gives me :
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 192.168.5.1
search local
and
cat /run/systemd/resolve/stub-resolv.conf gives me :
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0
search local
sudo lshw -C network gives me :
*-network
description: Wireless interface
product: Wireless 8265 / 8275
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:3a:00.0
logical name: wlp58s0
version: 78
serial: f8:63:3f:08:69:43
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=5.0.0-20-generic firmware=36.9f0a2d68.0 latency=0 link=no multicast=yes wireless=IEEE 802.11
resources: irq:129 memory:dc100000-dc101fff
*-network
description: Ethernet interface
product: Ethernet Connection (4) I219-V
vendor: Intel Corporation
physical id: 1f.6
bus info: pci@0000:00:1f.6
logical name: eno1
version: 21
serial: f4:4d:30:6a:0d:e7
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.1-4 ip=192.168.5.20 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:125 memory:dc280000-dc29ffff
*-network:0
description: Ethernet interface
physical id: 2
logical name: br-c20159f39807
serial: 02:42:82:dc:5c:c1
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.18.0.1 link=yes multicast=yes
*-network:1
description: Ethernet interface
physical id: 3
logical name: veth3e14a42
serial: 4e:59:53:86:1b:a8
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.130.45 link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:2
description: Ethernet interface
physical id: 4
logical name: vethb1a5fa9
serial: ea:45:16:b6:ee:13
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.6.237 link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:3
description: Ethernet interface
physical id: 5
logical name: docker0
serial: 02:42:18:4e:ed:2f
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.17.0.1 link=no multicast=yes
*-network:4
description: Ethernet interface
physical id: 6
logical name: veth1f469d7
serial: 46:51:7b:28:7a:11
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.74.93 link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:5
description: Ethernet interface
physical id: 7
logical name: vethcd445dd
serial: 26:6e:38:e2:da:1f
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.168.110 link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:6
description: Ethernet interface
physical id: 8
logical name: veth9810524
serial: ee:a9:1f:d7:e3:b7
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.61.7 link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:7
description: Ethernet interface
physical id: 9
logical name: veth538f6bc
serial: 5e:b5:25:5c:b9:5d
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.52.246 link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:8
description: Ethernet interface
physical id: a
logical name: br-03e193556b79
serial: 02:42:77:59:85:26
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.20.0.1 link=yes multicast=yes
*-network:9
description: Ethernet interface
physical id: b
logical name: vethb3f499f
serial: 6a:be:8c:01:13:ec
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.196.173 link=yes multicast=yes port=twisted pair speed=10Gbit/s
*-network:10
description: Ethernet interface
physical id: c
logical name: vethb56cefe
serial: 6a:74:3a:90:6b:60
size: 10Gbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.82.220 link=yes multicast=yes port=twisted pair speed=10Gbit/s
dpkg -l *dnsmasq*
andls -al /etc/resolv.conf
andcat /etc/resolv.conf
andcat /etc/network/interfaces
andcat /etc/systemd/resolved.conf
andsystem-resolve --status
and lastlycat /etc/NetworkManager/NetworkManager.conf
. I know that's a lot of stuff...systemd-resolve --status
. Is your /etc/resolv.conf after a manual edit? If so, what does it show after a reboot... 127.0.0.1 or 127.0.0.53? What aboutsudo systemctl status systemd-resolved
? Be sure to start comments to me with @heynnema, or I'll surely miss them.