DNS resolution randomly stops working

I had an issue previously where DNS resolution would stop working after disconnecting from a VPN connection. This initially appeared to be a problem with a 3rd party application, netextender, but would also occasionally occur when using an openVPN connection via network manager. This issue was present on my old laptop. I could usually resolve it by running

netconfig -f update

which would restore DNS resolution.

However, I have since installed LEAP 15 on a brand new laptop and am again having problems with DNS resolution. This time however, it just happens at random and has nothing to do with VPN connections (I’m not even using netextender anymore). Also, running the netconfig -f update command does not fix the problem anymore. I can only fix it by restarting the network from systemd.

Anyone have any advice on what to check so I can figure out what is causing this problem?

Thanks.

Look at (and post) the contents of /etc/resolv.conf when you have the problem.

You can of course also look there when you do not have the problem to give you an idea what works.

Is your system running with NSCD? Try running a while with nscd deactivated (it’s usually not needed), and try the same VPN connect+disconnect again.

(Maybe it’s one of the two hard problems of programming in action all over again:

  • naming things
  • cache invalidations
  • off-by-one errors

This is my favorite programming joke!) :slight_smile:

Cheers, good luck!

The resolv.conf file doesn’t change before or after I lose DNS resolution. The only uncommented line is

nameserver 192.168.1.1

Which is my router, obviously. The router isn’t the problem. I’ve tried changing it to 8.8.8.8, it doesn’t make any difference.

NSCD is running. I disabled it for host caching. Hopefully that will help. I’ll let you know.

Name caching isn’t required, but if in use you could try restarting it with

sudo systemctl restart nscd

nscd doesn’t seem to be the problem since it’s still happening. Seems to be getting worse too as it’s dropped out several times over the last couple hours. However, I think my problem might be some issue with IPv4 vs IPv6. When my connectivity drops out, I can resolve an IPv6 address, but cannot ping, nor resolve IPv4. For example, pinging google results in:

PING google.com(sea15s07-in-x0e.1e100.net (2607:f8b0:400a:800::200e)) 56 data bytes

--- google.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2051ms


But, after I either disconnect and reconnect to my router, or restart networking, I am able to resolve the IPv4 address and can again ping:

PING google.com (172.217.14.206) 56(84) bytes of data.
64 bytes from sea30s01-in-f14.1e100.net (172.217.14.206): icmp_seq=1 ttl=52 time=58.9 ms
64 bytes from sea30s01-in-f14.1e100.net (172.217.14.206): icmp_seq=2 ttl=52 time=60.7 ms
64 bytes from sea30s01-in-f14.1e100.net (172.217.14.206): icmp_seq=3 ttl=52 time=56.7 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms

I disabled IPv6 in Yast, which apparently did nothing because I still get this exact same result either way. Advice? Thanks.

Try setting “nameserver 8.8.8.8”; does it make any difference?

I tried that, it makes no difference.

Disabling IPv6 seems like a tricky thing nowadays. I disabled it in so many locations:

  • YaST-Networking

  • YaST sysconfig variables

  • custom initrd: dracut --omit “img-lib cifs fcoe fcoe-uefi rdma multipath iscsi qemu lvm mdraid dm dmraid cdrom pollcdrom plymouth . . . ipv6”

  • kernel boot parameter: ipv6.disable=1

  • NetworkManager (I don’t use wicked)

  • creating a file /etc/modprobe.d/blacklist-ipv6.conf, contents: blacklist ipv6

… and even then there’s the odd dracut script or systemd doodad having hard-coded ipv6 dependences (for example echoing a value into a virtual and now nonexisting /sys or /proc file, which results in errors usually ignored.)
Not that I’m against ipv6, I just prefer to disable anything optional (like nscd).

Meaning that, your Router should supply the needed DNS resolution via DHCP:

  1. Within YaST Network Settings, how are setting up the network? – with Network Manager or wicked?
  2. Within YaST Network Settings, is the standard route being resolved by means of DHCP
  3. Within YaST Network Settings, are you setting the host name by means of DHCP?
  4. Within YaST Network Settings, have specified a local domain name which corresponds to the domain name of the local network proposed by the router?
  5. Within YaST Network Settings, have you setup anything within the “Routing” tab?

The related openSUSE documentation is here: <https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.network.html#sec.network.yast&gt;.

  • Are you certain that, your Internet Service Provider (ISP) has only assigned an IPv4 address to your Router?
  • Are you certain that, your Router can properly handle DNS and, if your ISP is using IPv6, can your Router properly handle IPv6 DNS?

Answers to above questions:

  1. Network Manager
  2. Yes
  3. No. The host name is set in the etc/hostname file
  4. No. I have no local domain setup.
  5. No.

My ISP supports IPv4 and IPv6. It is set to obtain DNS automatically with both IPv4 and IPv6, however, I did note that there is no DNS server address for IPv6, only IPv4. But, other computers on my network don’t seem to have a problem with randomly losing DNS resolution, so I’m pretty sure the router is not the problem. Also, today, after restarting the network I am able to resolve and ping IPv6 addresses.

PING google.com(sea15s07-in-x0e.1e100.net (2607:f8b0:400a:800::200e)) 56 data bytes
64 bytes from sea15s07-in-x0e.1e100.net (2607:f8b0:400a:800::200e): icmp_seq=1 ttl=52 time=138 ms
64 bytes from sea15s07-in-x0e.1e100.net (2607:f8b0:400a:800::200e): icmp_seq=2 ttl=52 time=60.8 ms
64 bytes from sea15s07-in-x0e.1e100.net (2607:f8b0:400a:800::200e): icmp_seq=3 ttl=52 time=59.9 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms

Evidently sometimes it will resolve the IPv4 address, and other times it will resolve the IPv6 address and then sometimes it will just stop working. I re-enabled IPv6 in Yast.

Just to make sure there’s not some NM setting in your homedir / for your user:
Create a new user, login as that user, create the same networkconnection and see if the issue exists for that user. If not, delete the connection for your user and recreate it,

I just went ahead and deleted the network connection and recreated it to see if that fixes anything. The result seems to be, at least partially. I have the little exclamation point next to the networks widget indicating some kind of connection issue but I seem to be able to surf the net just fine, including making this post. However, I cannot ping anything using domain names. This is the first time I’ve encountered this issue. Previously I was not able to resolve anything be it a web browser or ping. Now, it’s just pinging that seems to be affected. Why would I be able to go to a webpage, but be unable to ping it from the command line? Pinging using an IP address works fine.

Thanks.

Update: I am unable to ping using IPv6, only IPv4. But, previously I was unable to surf the net when this happened as well, but now that seems to be unaffected. Is this likely an IPv6 issue with my ISP or router?

Yes, the evidence presented so far suggests an ISP-related issue IMHO.

I tried logging in under a newly created user, same problem. Also, this problem does not seem to be affecting my old laptop which also has leap 15 installed, which would seem to indicate it’s a problem with this laptop, specifically. I even tried a snapper rollback to a date from a couple weeks ago. That didn’t fix it either. Should I just do a clean install again? I’d rather not, but this constant connectivity problem is getting really annoying.

Have you examined the journal logging for clues about what might be occurring here?

Looking back through the thread… you mentioned that you’re using NM, so you could watch the logging on the fly with

sudo journalctl -fu NetworkManager

I’ve not encountered ‘intermittent’ DNS behaviour before, so never had to diagnose this type of issue. You might try running a traceroute to the DNS addresses configured in your router when you next have problems. FWIW, I’m using OpenDNS servers configured in my router.

Here is the output from the NM logs for this last time I lost connectivity. It looks like the connection is timing out after about 13 minutes, which seems to be approximately how long this takes to occur every time. There are some dhcp6 time out errors, but that’s normal from what I understand since IPv6 addresses are not usually assigned via dhcp (correct me if I’m wrong). But, 13 minutes after connecting I just get a timeout message, and that’s when I lose DNS. I can still ping IPv4 addresses however, even after the timeout error, and it generates no new logs. Any idea why the connection would just timeout?


an 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8186] device (wlan0): Activation: starting connection 'MySpectrumWiFie8-2G' (5f1a1420-1293-4454-a976-be4437a61b38)
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8188] audit: op="connection-activate" uuid="5f1a1420-1293-4454-a976-be4437a61b38" name="MySpectrumWiFie8-2G" pid=2082 uid=1000 result="success"
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8194] device (wlan0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8199] manager: NetworkManager state is now CONNECTING
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8217] device (wlan0): set-hw-addr: reset MAC address to 54:13:79:74:A1:0F (preserve)
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8433] device (wlan0): supplicant interface state: disconnected -> disabled
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8445] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8458] device (wlan0): Activation: (wifi) access point 'MySpectrumWiFie8-2G' has security, but secrets are required.
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8458] device (wlan0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8722] device (wlan0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8725] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8728] device (wlan0): Activation: (wifi) connection 'MySpectrumWiFie8-2G' has security, and secrets exist.  No new secrets needed.
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8728] Config: added 'ssid' value 'MySpectrumWiFie8-2G'
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8729] Config: added 'scan_ssid' value '1'
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8729] Config: added 'bgscan' value 'simple:30:-80:86400'
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8729] Config: added 'key_mgmt' value 'WPA-PSK'
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8729] Config: added 'auth_alg' value 'OPEN'
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8729] Config: added 'psk' value '<hidden>'
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.8985] device (wlan0): supplicant interface state: disabled -> disconnected
Jan 08 16:58:35 precision NetworkManager[14316]: <info>  [1546991915.9107] device (wlan0): supplicant interface state: disconnected -> scanning
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8144] device (wlan0): supplicant interface state: scanning -> authenticating
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8484] device (wlan0): supplicant interface state: authenticating -> associating
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8487] device (wlan0): supplicant interface state: associating -> 4-way handshake
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8493] device (wlan0): supplicant interface state: 4-way handshake -> completed
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8494] device (wlan0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful.  Connected to wireless network 'MySpectrumWiFie8-2G'.
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8693] device (wlan0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8696] dhcp4 (wlan0): activation: beginning transaction (timeout in 45 seconds)
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.8710] dhcp4 (wlan0): dhclient started with pid 16043
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9651] dhcp4 (wlan0):   address 192.168.1.2
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9651] dhcp4 (wlan0):   plen 24 (255.255.255.0)
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9652] dhcp4 (wlan0):   gateway 192.168.1.1
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9652] dhcp4 (wlan0):   lease time 259200
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9653] dhcp4 (wlan0):   nameserver '192.168.1.1'
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9653] dhcp4 (wlan0):   domain name 'home'
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9654] dhcp4 (wlan0): state changed unknown -> bound
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9686] device (wlan0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9711] device (wlan0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9719] device (wlan0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9723] manager: NetworkManager state is now CONNECTED_LOCAL
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9764] manager: NetworkManager state is now CONNECTED_SITE
Jan 08 16:58:40 precision NetworkManager[14316]: <info>  [1546991920.9767] policy: set 'MySpectrumWiFie8-2G' (wlan0) as default for IPv4 routing and DNS
Jan 08 16:58:41 precision NetworkManager[14316]: nisdomainname: you must be root to change the domain name
Jan 08 16:58:41 precision NetworkManager[14316]: <info>  [1546991921.1184] device (wlan0): Activation: successful, device activated.
Jan 08 16:58:42 precision NetworkManager[14316]: <info>  [1546991922.5528] manager: NetworkManager state is now CONNECTED_GLOBAL
Jan 08 16:58:43 precision NetworkManager[14316]: <info>  [1546991923.5841] dhcp6 (wlan0): activation: beginning transaction (timeout in 45 seconds)
Jan 08 16:58:43 precision NetworkManager[14316]: <info>  [1546991923.5875] dhcp6 (wlan0): dhclient started with pid 16212
Jan 08 16:58:43 precision NetworkManager[14316]: <info>  [1546991923.5909] policy: set 'MySpectrumWiFie8-2G' (wlan0) as default for IPv6 routing and DNS
Jan 08 16:59:28 precision NetworkManager[14316]: <warn>  [1546991968.5507] dhcp6 (wlan0): request timed out
Jan 08 16:59:28 precision NetworkManager[14316]: <info>  [1546991968.5508] dhcp6 (wlan0): state changed unknown -> timeout
Jan 08 16:59:28 precision NetworkManager[14316]: <info>  [1546991968.5518] dhcp6 (wlan0): canceled DHCP transaction, DHCP client pid 16212
Jan 08 16:59:28 precision NetworkManager[14316]: <info>  [1546991968.5519] dhcp6 (wlan0): state changed timeout -> done
Jan 08 17:12:30 precision NetworkManager[14316]: <info>  [1546992750.5528] connectivity: (wlan0) timed out
Jan 08 17:12:30 precision NetworkManager[14316]: <info>  [1546992750.5529] manager: NetworkManager state is now CONNECTED_SITE

Hmmm…a power management issue perhaps?

https://askubuntu.com/questions/1030653/wifi-randomly-disconnected-on-ubuntu-18-04-lts