Hostnames entries no longer being followed

After a recent 3,000+ file Tumbleweed update, local hostnames are no longer being followed. For example, my home server which used to be available at (example) myusedtoworkserver.lan now fails with “not found” errors.

Using the IP address of the server directly still works.

Have tried re-editing / re-saving the hosts file both through YaST (Hostnames tool) and shell.

Still working here after that update.

Maybe check “/etc/nsswitch.conf” (and “/usr/etc/nsswitch.conf”).


#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       compat                  Use compatibility setup
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       [NOTFOUND=return]       Stop searching if not found so far
#
# For more information, please read the nsswitch.conf.5 manual page.
#
passwd: compat
group:  compat
shadow: compat

hosts:          [NOTFOUND=return] files mdns_minimal dns
networks:       files dns

services:       files usrfiles
protocols:      files usrfiles
rpc:            files usrfiles
ethers:         files
netmasks:       files
netgroup:       files nis
publickey:      files

bootparams:     files
automount:      files nis
aliases:        files


#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# Valid databases are: aliases, ethers, group, gshadow, hosts,
# initgroups, netgroup, networks, passwd, protocols, publickey,
# rpc, services, and shadow.
#
# Valid service provider entries include (in alphabetical order):
#
#       compat                  Use /etc files plus *_compat pseudo-db
#       db                      Use the pre-processed /var/db files
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files in /etc
#       hesiod                  Use Hesiod (DNS) for user lookups
#       nis                     Use NIS (NIS version 2), also called YP
#       nisplus                 Use NIS+ (NIS version 3)
#
# See `info libc 'NSS Basics'` for more information.
#
# Commonly used alternative service providers (may need installation):
#
#       ldap                    Use LDAP directory server
#       myhostname              Use systemd host names
#       mymachines              Use systemd machine names
#       mdns*, mdns*_minimal    Use Avahi mDNS/DNS-SD
#       resolve                 Use systemd resolved resolver
#       sss                     Use System Security Services Daemon (sssd)
#       systemd                 Use systemd for dynamic user option
#       winbind                 Use Samba winbind support
#       wins                    Use Samba wins support
#       wrapper                 Use wrapper module for testing
#
# Notes:
#
# 'sssd' performs its own 'files'-based caching, so it should generally
# come before 'files'.
#
# WARNING: Running nscd with a secondary caching service like sssd may
#          lead to unexpected behaviour, especially with how long
#          entries are cached.
#
# Installation instructions:
#
# To use 'db', install the appropriate package(s) (provide 'makedb' and
# libnss_db.so.*), and place the 'db' in front of 'files' for entries
# you want to be looked up first in the databases, like this:
#
# passwd:    db files
# shadow:    db files
# group:     db files

passwd:         compat
group:          compat
shadow:         compat
# Allow initgroups to default to the setting for group.
# initgroups:   compat

hosts:          files dns
networks:       files dns

aliases:        files usrfiles
ethers:         files usrfiles
gshadow:        files usrfiles
netgroup:       files nis
protocols:      files usrfiles
publickey:      files
rpc:            files usrfiles
services:       files usrfiles

automount:      files nis
bootparams:     files
netmasks:       files

And which file is supposed to be /etc/nsswitch.conf and which file /usr/etc/nsswitch.conf?

In other words: Please always include your command line to the computer text you post. It is only one more line at the top.

The first is /etc/nsswitch.conf

The second is /usr/etc/nsswitch.conf

I figured that would be logical enough for anyone to follow.

Yes; both files contain " # /etc/nsswitch.conf " at their start.

As always, use the ping command to test network connectivity… First by IP address, and then by hostname…
If the ping command works, then the problem is something else.

So, verifying…
You’re not using DNS to provide name resolution to your server, you’re relying on /etc/hosts?

TSU

Ping tests were some of the first things I did before posting here.

Ping to the hostname no longer works. “Name or service not known.” It worked before the Tumbleweed update.

Ping to the IP address directly works as expected.

Correct that DNS does not provide resolution to the server (which is inside my house). Has always been through the /etc/hosts file.

No services provided by the server are reachable through the hostname any longer, such as WWW or rsync or Samba shares. They work when the direct IP is used, however.

This is wrong…

hosts:          [NOTFOUND=return] files mdns_minimal dns

It should look more like

hosts:          files mdns_minimal [NOTFOUND=return] dns

[QUOTE=8876523450;2960470]


hosts:          [NOTFOUND=return] files mdns_minimal dns

That looks weird.

I see:


hosts:        files mdns_minimal [NOTFOUND=return] dns

I suggest you try editing that “hosts” line to move the “[NOTFOUND=return]” to after the mdns_minimal (in “/etc/nsswitch.conf”)

Snap - see previous post. :wink:

The ‘[NOTFOUND=return]’ directive at the beginning of the ‘hosts:’ entry effectively stops any hostname resolution methods from being attempted.

Changing to “files mdns_minimal dns” plus a reboot fixed the problem.

Now to wonder why the last Tumbleweed update changed the entry to a broken condition.

Hi
No changes here, at some point have you edited the file? Have you run rpmconfigcheck lately?

I have never changed those files myself. Until now, I didn’t know them.

I have needed to switch from Leap to Tumbleweed in years past to get software that I wanted. Perhaps this is a cause.

rpmconfigcheck returns:


sudo rpmconfigcheck
[sudo] password for root: 
Searching for unresolved configuration files
Please check the following files (see /var/adm/rpmconfigcheck):
    /etc/chrony.conf.rpmnew
    /etc/firewalld/firewalld.conf.rpmnew
    /etc/fonts/conf.d/30-metric-aliases.conf.rpmsave
    /etc/localtime.rpmnew
    /etc/mime.types.rpmsave
    /etc/nsswitch.conf.rpmnew
    /etc/postfix/main.cf.rpmnew
    /etc/postfix/master.cf.rpmnew
    /etc/pulse/client.conf.d/50-system.conf.rpmsave
    /etc/sane.d/dll.conf.rpmnew
    /etc/speech-dispatcher/speechd.conf.rpmnew
    /etc/sysctl.conf.rpmnew

Is this a sign of problems?

Hi
I normally do a diff on the new vs old to see what has changed. I see you have a /etc/nsswitch.conf.rpmnew file so at some point something must have touched the original file…


diff -Naur /etc/nsswitch.conf  /etc/nsswitch.conf.rpmnew

nss_mdns does it for sure and I think it is installed on every system.

Hi
On TW, Leap 15.1, SLES 15 SP1, SLES 15 SP2 and SLED 15 SP2 I see;


cat /etc/nsswitch.conf |grep "hosts:"
hosts:      files dns

On Leap 15.2 I see;


cat /etc/nsswitch.conf |grep "hosts:"
hosts:      files mdns_minimal [NOTFOUND=return] dns