Local network hosts not resolved since Mint 19

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Pheeble
Level 3
Level 3
Posts: 116
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

Local network hosts not resolved since Mint 19

Post by Pheeble »

I have a local network of (currently) six computers. One is running dnsmasq in Ubuntu Server 16.04 to provide static addresses and host names for the network client computers. Client computers running Linux Mint 18.3 XFCE resolve local host names perfectly without any manual configuration required.

I performed a clean install of Linux Mint 19 XFCE on one client. It gets the correct static IP address, but it is unable to resolve any other local client host names. For example, the server's host name is 'emachine', aka 192.168.0.10. In Mint 18.3 'ping emachine' works as expected. In Mint 19, however, the response is 'ping: emachine: Name or service not known'.

If I run 'dig @192.168.0.10 emachine', the correct address is returned. This also works for any other client on the network.

If I insert '192.168.0.10 emachine' into '/etc/hosts' the name resolution works, but I would prefer not to have to edit the 'etc/hosts' file on every computer each time the network changes.

From what I have read this seems to be an issue with Ubuntu 18.04 using systemd for name resolution. Unfortunately I have not found any simple solutions to fix this problem.

Is there any way to make Linux Mint 19 work with my dnsmasq server as easily as it did in Linux Mint 18.3 and previous versions?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Pheeble
Level 3
Level 3
Posts: 116
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

Re: Local network hosts not resolved since Mint 19

Post by Pheeble »

Ok, it seems that systemd-resolved creates two files each with different nameserver info, /run/systemd/resolve/stub-resolv.conf and /run/systemd/resolve/resolv.conf, the contents of which are as follows:

/run/systemd/resolve/stub-resolv.conf lists a nameserver 127.0.0.53. Why? No idea. It's obviously wrong for my network.

Code: Select all

# 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 "systemd-resolve --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
search lan
/run/systemd/resolve/resolv.conf contains the correct nameserver address, presumably obtained from my dnsmasq server.

Code: Select all

# 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.0.10
nameserver fe80::e2b9:e5ff:feda:a5a8%2
search lan
The problem seems to be that systemd-resolved creates the file /etc/resolv.conf that is a symlink to /run/systemd/resolve/stub-resolv.conf.

I deleted /etc/resolv.conf and then recreated it as a new symlink pointing to /run/systemd/resolve/resolv.conf. Hey presto, name resolution suddenly works:

Code: Select all

ping -c 1 emachine
PING emachine (192.168.0.10) 56(84) bytes of data.
64 bytes from emachine (192.168.0.10): icmp_seq=1 ttl=64 time=0.079 ms

--- emachine ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.079/0.079/0.079/0.000 ms
Solution summary:

Code: Select all

sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
Last edited by Pheeble on Sat Nov 03, 2018 7:21 pm, edited 1 time in total.
ajgringo619

Re: Local network hosts not resolved since Mint 19

Post by ajgringo619 »

127.0.0.53 is used by systemd-resolved; mine shows the same thing. What does nmcli device show return?
Pheeble
Level 3
Level 3
Posts: 116
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

Re: Local network hosts not resolved since Mint 19

Post by Pheeble »

ajgringo619 wrote: Sat Nov 03, 2018 2:16 am 127.0.0.53 is used by systemd-resolved; mine shows the same thing. What does nmcli device show return?
Exactly the same whether name resolution is working or not.

Before changing the /etc/resolv.conf symlink (name resolution not working):

Code: Select all

ll /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Nov  3 16:32 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

nmcli device show
GENERAL.DEVICE:                         enp7s0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         1C:6F:65:93:00:9D
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Wired connection 1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.0.43/24
IP4.GATEWAY:                            192.168.0.1
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.0.1, mt = 100
IP4.ROUTE[2]:                           dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[3]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]:                             192.168.0.10
IP6.ADDRESS[1]:                         fdb7:41c3:578b:0:e8a8:2ac9:c32e:6a4e/64
IP6.ADDRESS[2]:                         fdb7:41c3:578b:0:ae00:4b10:efd5:b2f4/64
IP6.ADDRESS[3]:                         fe80::c832:3330:12c6:1371/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fdb7:41c3:578b::/48, nh = fe80::e2b9:e5ff:feda:a5a8, mt = 100
IP6.ROUTE[2]:                           dst = fdb7:41c3:578b::/64, nh = ::, mt = 100
IP6.ROUTE[3]:                           dst = ff00::/8, nh = ::, mt = 256, table=255
IP6.ROUTE[4]:                           dst = fe80::/64, nh = ::, mt = 256
IP6.ROUTE[5]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.DNS[1]:                             fe80::e2b9:e5ff:feda:a5a8

GENERAL.DEVICE:                         lo
GENERAL.TYPE:                           loopback
GENERAL.HWADDR:                         00:00:00:00:00:00
GENERAL.MTU:                            65536
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.ADDRESS[1]:                         127.0.0.1/8
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         ::1/128
IP6.GATEWAY:                            --

ping -c 1 emachine
ping: emachine: Name or service not known
After changing the symlink (name resolution working):

Code: Select all

ll /etc/resolv.conf
lrwxrwxrwx 1 root root 32 Nov  3 16:37 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf

nmcli device show
GENERAL.DEVICE:                         enp7s0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         1C:6F:65:93:00:9D
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Wired connection 1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.0.43/24
IP4.GATEWAY:                            192.168.0.1
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.0.1, mt = 100
IP4.ROUTE[2]:                           dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[3]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]:                             192.168.0.10
IP6.ADDRESS[1]:                         fdb7:41c3:578b:0:e8a8:2ac9:c32e:6a4e/64
IP6.ADDRESS[2]:                         fdb7:41c3:578b:0:ae00:4b10:efd5:b2f4/64
IP6.ADDRESS[3]:                         fe80::c832:3330:12c6:1371/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fdb7:41c3:578b::/48, nh = fe80::e2b9:e5ff:feda:a5a8, mt = 100
IP6.ROUTE[2]:                           dst = fdb7:41c3:578b::/64, nh = ::, mt = 100
IP6.ROUTE[3]:                           dst = ff00::/8, nh = ::, mt = 256, table=255
IP6.ROUTE[4]:                           dst = fe80::/64, nh = ::, mt = 256
IP6.ROUTE[5]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.DNS[1]:                             fe80::e2b9:e5ff:feda:a5a8

GENERAL.DEVICE:                         lo
GENERAL.TYPE:                           loopback
GENERAL.HWADDR:                         00:00:00:00:00:00
GENERAL.MTU:                            65536
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.ADDRESS[1]:                         127.0.0.1/8
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         ::1/128
IP6.GATEWAY:                            --

ping -c 1 emachine
PING emachine (192.168.0.10) 56(84) bytes of data.
64 bytes from emachine (192.168.0.10): icmp_seq=1 ttl=64 time=0.167 ms

--- emachine ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.167/0.167/0.167/0.000 ms
ajgringo619

Re: Local network hosts not resolved since Mint 19

Post by ajgringo619 »

I believe that systemd-resolved will change the link to /etc/resolv.conf on the next restart. If you're going to use Network Manager, you need to make the DNS changes there.
Pheeble
Level 3
Level 3
Posts: 116
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

Re: Local network hosts not resolved since Mint 19

Post by Pheeble »

ajgringo619 wrote: Sat Nov 03, 2018 11:55 am I believe that systemd-resolved will change the link to /etc/resolv.conf on the next restart. If you're going to use Network Manager, you need to make the DNS changes there.
I've restarted the computer several times since changing /etc/resolv.conf to point to /etc/systemd/resolve/resolv.conf, and the change has persisted.

Also, the DNS in Network Manager has been correct from the beginning, ie. 192.168.0.10. Given that the correct DNS was saved in /run/systemd/resolve/resolv.conf, my guess is that systemd-resolved had the correct DNS address but for some reason it ignored it and continued to use 127.0.0.53 anyway.
lucky62

Re: Local network hosts not resolved since Mint 19

Post by lucky62 »

I have the similar problem with DNS after upgrade from 18.3 to 19 (LM 19 Cinnamon).
I must note that upgrade was problematic. It crashed and I must finish it manually to call dpkg-reconfigure and apt-get upgrade several times..

Now I see that Network manager is ignoring name servers provided by my WIFI Router via DHCP and DNS server is set to 8.8.8.8 (Google).
May be some configuration rests from LM18.3 are causing problems...

/etc/resolv.conf is a link (it is normal):

Code: Select all

#ls -l /etc/resolv.conf 
lrwxrwxrwx 1 root root 37 nov  5 19:41 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
Content of stub-resolv.conf and resolv.conf:

Code: Select all

#cat /run/systemd/resolve/stub-resolv.conf
# 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 "systemd-resolve --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



#cat /run/systemd/resolve/resolv.conf
# 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 8.8.8.8
systemd-resolve status:

Code: Select all

root@t470:/home/lucky62# systemd-resolve --status
Global
          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
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 4 (vboxnet0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (wlp4s0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 8.8.8.8

Link 2 (enp0s31f6)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
NetworkManager debug log when connecting to wifi is attached.
NM_Debug.zip
What else I need to check?
How can I set the all DNS related settings to defaults? (what packages I need to reconfigure?)
Pheeble
Level 3
Level 3
Posts: 116
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

Re: Local network hosts not resolved since Mint 19

Post by Pheeble »

@lucky62

Have you tried changing the symlink '/etc/resolv.conf' from '/run/systemd/resolve/stub-resolv.conf' to '/run/systemd/resolve/resolv.conf'?

This worked for me:

Code: Select all

sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
lucky62

Re: Local network hosts not resolved since Mint 19

Post by lucky62 »

This is not working, beause /run/systemd/resolve/resolv.conf is refering to the google DNS (8.8.8.8).
So /etc/resolv.conf is a link to the /run/systemd/resolve/stub-resolv.conf which is refering to the local DNS (127.0.0.53).

Which is ok. What is not ok, is the fact, that systemd (or NetworkManager or whatever else) is ignoring DNS provided by router via DHCP...
Locked

Return to “Networking”