After the new install yesterday of Leap15.2 I had no internet connection. IP addresses were there and I could ping the router but the nslookup command did not come up with a result. I found no file /etc/resolv.conf file. After writing this file manually the internet IP addresses were resolved and the internet was there. Today after booting up the internet again was not there and no /etc/resolv.conf file. Again I wrote a new file with the DNS servers and the internet was there. What is going on? Do I have to write every day a new /etc/resolv.conf file to go to the internet or how does the computer with LEap15.2 resolve the IP addresses?
Would help if you described whether you are using Wicked or NetworkManager.
That being said, on 15.2 netconfig handles the resolv.conf, yp.conf etc.
sudo netconfig update -f should update the symlink to properly reflect the new setup. /etc/resolv.conf should be a symlink to /var/run/netconfig/resolv.conf
Thank you Miuku. Yes I should have said running KDE and Network Manager. Thank you for your reply - I ran** netconfig update -f** as root and now the l for link is in front of /etc/resolv.conf when checking with ls -l . I hope this solves the problem.
OK, I have been away and since I am back I have updated 4 computers to Leap15.2. Two computers (one laptop and one desktop) lost their /etc/resolv.conf file and consequently could not get to the internet - the other two computers are fine. The command (as root) “netconfig update -f” does not make any difference. After a reboot the resolv.conf file is gone again and the internet not available. How can I make sure the file resolv.conf stays? Is there another way to resolve the IP addresses now? How can I solve this on these two computers permanently?
On newer systems, “/etc/resolv.conf” should be a symbolic link to the real “resolv.conf” which is in a tmpfs file system (exists only in ram/swap). The “netconfig update -f” is supposed to create the symbolic link if not already there, and create the file as needed. But if you are look via a rescue mount, the file won’t be there but the symbolic link should be there.
If I recall, handling “/etc/resolv.conf” this way was already working in Leap 15.1.
Thank you, nrickert, for your reply. Unfortunately it does not help me. When booting up the IP addresses are not resolved because there is no /etc/resolv.conf file and when I write this file it works again. How can I fix this that the computer knows the DNS servers? I use openDNS and I must be able to enter them somewhere. I don’t know what a rescue mount is either. I use Linux for 20 years but I am no IT person and up to now I could just create my own resolv.conf file (including changing the /etc/sysconfig/network/config file to “NETCONFIG_DNS_POLICY=’’”). This worked on all our 5 computers (4 Leap and 1 Tumbleweed) which are for private use and for our little business. Now suddenly after the update to 15.2 2 computers loose the resolv.conf file after reboot. I have even entered the DNS server’s IP addresses in /etc/sysconfig/network/config in “NETCONFIG_DNS_STATIC_SERVERS=208.67.222.222 208.67.220.220 2620:0:ccc::2 2620:0:ccd::2” but that doesn’t help either. What next?
Oops, wrong tab.
Using NETCONFIG settings is appropriate. But I would suggest doing that with
Yast → System → Network Settings
That’s the best way of getting the format right.
YAST does not work with NetworkManager. If I use wicked to enter it and switch back to NetworkManager will YAST then not ignore it?
Show us
ls -la /etc/resolv.conf
thanks deano_ferrari here it is:
:~> ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 30 Jul 16 00:55 /etc/resolv.conf -> /var/run/netconfig/resolv.conf
I changed to wicked entered the DNS servers in YAST clicked OK then changed to NetworkManager and rebooted - same result /etc/resolv.conf was gone.
Found something else on the internet - to enter in /etc/NetworkManager/NetworkManager.conf the line “dns=none” so it looks like this:
[main]
plugins=ifupdown,keyfile
dns=none
rebooted and same thing - /etc/resolv.conf was gone.
I tried as root
chattr +i /etc/resolv.conf
chattr: Operation not supported while reading flags on /etc/resolv.conf
I don’t really know what to do next - maybe a boot script which copies the file /etc/resolv.conf at boot? Seems very clunky bit if that is the only thing that works???
Hmm, that’s a change. I’m pretty sure that in the past you could still click on the “hostname/DNS” tab and make settings there. I’m not sure whether they were honored.
If you switch to NetworkManager and make the changes, those will be saved in “/etc/sysconfig/network”. And those changes should stay there when you switch back to NetworkManager. But I don’t know whether they are honored (followed) in that case.
There’s probably a NetworkManager setting for DNS. But I’m running “wicked” on this computer, so I can’t easily check.
Yes nrickert, in YAST the DNS settings are greyed out. You can set them in Network manager if you right-click the network manager icon you can go to the tabs IPv4 and IPv6 and enter the DNS servers there. Only it does not make any difference. After a reboot there is still no resolv.conf file and no DNS server can be used. The nslookup command times out until the resolv.conf file is written manually. I have now tried so many different things and nothing works on two of my 4 computers where I had no problem with Leap15.1. Something must have changed that it is no longer working. I would have thought entering it in the windoe "configure Network Connections in NetworkManager would do the trick. I further thought entering the DNS servers in the /etc/sysconfig/network/config file would do the trick. But after a reboot everything is gone and I don’t know any further steps.
This might need a bug report.
The problem is I have the same settings on my Tumbleweed computer and 2 other Leap15.2 computer and there it works without problems. What to write in a bug report? That sometimes there are no DNS servers even though they are entered in NM or in the config file?
Observe the NetworkManager output with
sudo journalctl -fu NetworkManager
Then begin to connect eg unplug and plug the ethernet cable, or ‘Disconnect’ then 'Reconnect via NM. You might need to repeat a few times to see whether there is any inconsistent behaviour.
/var/run must be link to /run and /etc/resolv.conf should be link to /run/netconfig/resolv.conf. What is output of
ls -l /var/run
grep /run /proc/self/mountinfo
Thanks you, deano_ferrari and arvidjaar for your replies . Here is the output of:
uli@linux-7b8y:~> ls -l /var/run
lrwxrwxrwx 1 root root 6 Aug 2 2016 /var/run -> ../run
uli@linux-7b8y:~> grep /run /proc/self/mountinfo
28 96 0:24 / /run rw,nosuid,nodev shared:23 - tmpfs tmpfs rw,mode=755
735 28 0:72 / /run/user/1000 rw,nosuid,nodev,relatime shared:356 - tmpfs tmpfs rw,size=805468k,mode=700,uid=1000,gid=100
489 735 0:69 / /run/user/1000/gvfs rw,nosuid,nodev,relatime shared:217 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1000,group_id=100
524 28 8:33 / /run/media/uli/ADATA\040UFD rw,nosuid,nodev,relatime shared:231 - vfat /dev/sdc1 rw,uid=1000,gid=100,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro
uli@linux-7b8y:~>
deano_ferrari I tried the command
journalctl -fu NetworkManager
The problem is it shows just that the connection is there whether it has DNS servers to resolve the IP addresses or not. I did the following and there was no output in the journalctl file:
linux-7b8y:~ # cat /etc/resolv.conf
# IPv4 name servers OpenDNS:
nameserver 208.67.222.222
nameserver 208.67.220.220
# IPv6 name servers OpenDNS:
nameserver 2620:0:ccc::2
nameserver 2620:0:ccd::2
linux-7b8y:~ # netconfig update -f
linux-7b8y:~ # cat /etc/resolv.conf
### /etc/resolv.conf is a symlink to /var/run/netconfig/resolv.conf
### autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
# NETCONFIG_DNS_STATIC_SEARCHLIST
# NETCONFIG_DNS_STATIC_SERVERS
# NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
# NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
### Call "netconfig update -f" to force adjusting of /etc/resolv.conf.
linux-7b8y:~ # cp /home/uli/resolv.conf /etc
linux-7b8y:~ # cat /etc/resolv.conf
# IPv4 name servers OpenDNS:
nameserver 208.67.222.222
nameserver 208.67.220.220
# IPv6 name servers OpenDNS:
nameserver 2620:0:ccc::2
nameserver 2620:0:ccd::2
linux-7b8y:~ #
First I had the DNS servers in the resolv.conf file. The netconfig update -f command replaced the resolv.conf file with the header which used to be in the resolv.conf file but without any DNS servers. Then I copied the sample resolv.conf file which I saved into the home directory back into /etc. You can see then that the DNS server’s IP addresses are back in the /etc/resolvconfig file. As I did this I googled for something. When I had no DNS servers of course no website came up, Wen they were back the sites came up again. However there was no change in the output of the journalctl command because the connection was up. When I disconnected the connection through NetworkMananger the messages came up straight away in the journalctl console. So I am not sure how this command can help here.
Not sure what you meant by this. The journalctl command was requested to observe NetworkManager logging, and the idea was to run it before connecting to capture the connection process. In any case, this does appear to be an issue with netconfig perhaps.
Yes, this is the crux of it. I can’t replicate this issue.
However there was no change in the output of the journalctl command because the connection was up.When I disconnected the connection through NetworkMananger the messages came up straight away in the journalctl console. So I am not sure how this command can help here.
No, it won’t. It was only to be used during the connection process, and explicitly because I thought perhaps sometimes your DHCP connection wasn’t passing DNS servers. (It is also possible to manually set these of course).