YaST Hostnames changes do not survive reboots

It means that when I make changes in the YaST control panel, then reboot, the changes are gone.

They should be permanently saved.

You may be on to something …

grep hosts /etc/nsswitch.conf
# Valid databases are: aliases, ethers, group, gshadow, hosts,
hosts:          files mdns_minimal [NOTFOUND=return] dns

I am also noting that /etc/resolv.conf is not updating correctly.

It always contains:


It should be updating with DNS information received during boot and DHCP addressing. (I think?)

It won’t if you’ve manually edited to start with AFAIR.

I found the fix to this.

/etc/resolv.conf was a text file when it’s supposed to be a symlink to /run/netconfig/resol

I don’t think that’s the culprit. I have the same line - must be default. YaST modifications work well and persist, I have just added with a testname - survived the reboot. Deleted it manually, all well. In


I can check the ruby module is readily reading the information from /etc/hosts. I had a wrong umask entry there - has been read in as address - hostname, too. :face_with_open_eyes_and_hand_over_mouth:
If you want to go deeper you may try a similar test. After adding it in YaST, check /etc/hosts. Has it been added at all? Was /etc/hosts.YaST2save created or modified?

If no, maybe you can find something suspicious in /var/log/YaST2/y2log?
If yes, probably something is overwriting it? Ah, nearly missed this one:

I’m sure you must find some hint in the log file. Here, I have lines like:

2023-03-28 22:12:35 <1> pluto.mydomain(11397) [Ruby] cfa/hosts.rb(add_entry):148 adding new entry for ip

Does /usr/share/YaST2/lib/cfa/hosts.rb exist? If YaST doesn’t find your manual entry , maybe somethings wrong with that module? I’m on Leap 15.4, so my findings are not 100% representative for you.

Simplest try maybe force reinstall of yast-network?