today for no reason the DNS resolving stopped working on my openSUSE tubleweed for no reason. I tried to supply a DNS server from the connection’s settings but it wouldn’t work, but directly pinging on an ip worked. On a quick look on google I found out that messing with /etc/resolv.conf and adding “nameserver DNS_IP”, it would do the trick although it doesn’t look the right way to do it.
[Check 07/07/2017 edit as well]
Originally my resolv.conf file looked like:
### /etc/resolv.conf file autogenerated by netconfig!
and with the fast patch would look like
### /etc/resolv.conf file autogenerated by netconfig! nameserver 192.168.42.129
As shown on openSUSE forum on an older thread removing previously mentioned file and restarting the NetworkServices fixes the problem. Remove the resolv.conf so it would get generated again.
> su -c 'rm /etc/resolv.conf && systemctl restart NetworkManager.service'
— update [26/09/2016]: It seems that there is an other nifty solution to the same problem, check goinggnu’s post about the same problem!
— update [07/07/2017]: The same problem has resurfaced, DNS information from DHCP do not get used properly from the connection manager and DNS fields are not set. Check the information from the dhclient and manually insert them in the network profile. This is especially necessary when connected on a limited network that filters remote DNS queries, else you can use any other DNS server of your preference in the /etc/resolv.conf file or per profile.
# view dhclient info > cat /var/lib/dhcp/dhclient.leases
# restart network services > systemctl restart network
In case that you have set some DNS server in /etc/resolv.conf and you are in a filtered environment it won’t work. To make it work delete the file and then continue with the instructions in the update section.