After laptop resumes from Standby I lose DNS

Hey guys, I’m having a weird issue and was wondering if anyone had any ideas on how to troubleshoot, or any ideas on what’s going on.

So the problem is relatively simple, when when I open my computer from standby, I don’t have dns. I have internet, but my dns isn’t working. I reboot my computer, and all is well. I should preface that I’m a network engineer, and I also work at the ISP I get my internet from, so I know a little bit how this stuff works. The problem doesn’t happen all the time, but most of the time.

My laptop is a Thinkpad X1 Carbon 7th gen. I did swap the BIOS from windows mode to LInux mode and that helped with some other issues, but hasn’t helped with this one. Any ideas would be appreciated! Thanks!

How have you configured DNS?

pacman -Qs resolv

…I will quickly go over how I set up mine.

These packages:
systemd-resolvconf
openvpn-update-systemd-resolved ##(required for openvpn - otherwise unnecessary)

And to use the automated systemd-resolved we want to get rid of the resolvconf file and create a symlink:

sudo mv /etc/resolv.conf /etc/resolv.conf.2023.bak
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Of course you need the service running, ex:

systemctl enable --now systemd-resolved.service

These files (click for content);

This will stop NetworkManager from interfering:

/etc/NetworkManager/conf.d/rc-manager.conf
[main]
rc-manager=symlink
/etc/NetworkManager/conf.d/dns.conf
[main]
dns=systemd-resolved

I also set it to prefer IPv4:

/etc/NetworkManager/conf.d/prefer-ipv4-dns.conf
[connection]
ipv4.dns-priority=100
ipv6.dns-priority=200

And I dont like the ping to arch to ‘check connectivity’ so its disabled ala:

/etc/NetworkManager/conf.d/20-connectivity.conf
[connectivity]
uri=
#uri=https://www.archlinux.org/check_network_status.txt
#interval=3200

You dont necessarily need the DNSSEC settings of course, but I have it this way so that it will use it when available:

/etc/systemd/resolved.conf.d/dnssec.conf
[Resolve]
DNSSEC=allow-downgrade

Similar for DNS-over-TLS … I have this disabled currently, but posted here for reference:

/etc/systemd/resolved.conf.d/dns_over_tls.conf
[Resolve]
DNSOverTLS=opportunistic

And heres the more juicy bits for configuring DNS now that we have the service/symlink/etc up.
I use the fallback variant because it works better to reset the DNS if I disable VPN.

You should only need ONE of the following:

/etc/systemd/resolved.conf.d/fallback_dns.conf
[Resolve]
FallbackDNS=1.1.1.1 1.0.0.1 127.0.0.1 ::1
/etc/systemd/resolved.conf.d/dns_servers.conf
[Resolve]
DNS=1.1.1.1 1.0.0.1
Domains=~.

Alrighty … I hope that helps.
I included some extra stuff … but you said you work in the industry so :saluting_face:

1 Like

I do work in the industry but I am not even close to the linux expert you guys are! As far as I have things configured, I guess I should have stated that in my first post, that would have helped…

It’s all defaults, in DHCP. When my laptop resumes I check and my computer lists the correct DNS servers in the DHCP lease, it’s just for some reason the DNS isn’t working.

I’ll go over some of the stuff you posted, thanks for the reply!

Here’s the output of that command:

local/libmicrodns 0.2.0-1
Minimal mDNS resolver library
local/openresolv 3.13.2-1
resolv.conf management framework (resolvconf)

Ok, using DHCP and openresolv… how did you implement your DNS selection?

PS, heres some wiki entries:
https://wiki.archlinux.org/title/Openresolv
https://wiki.archlinux.org/title/Dhcpd
https://wiki.archlinux.org/title/Domain_name_resolution

I guess I’ll have to look into it, everything is defaults so far, I just installed Manjaro a couple days ago.

Im not sure I follow…

Is the machine acting as the DHCPD server? Or its using DHCP as a client? Or both?

More PS:

  • ISC has ended development on the ISC DHCP client as of early 2022. This client implementation is no longer maintained and should not be used in production any longer.
  • You should not run two DHCP clients simultaneously.
  • Instead of directly using a standalone DHCP client you can also use a network manager, some of which have a built-in DHCP client.

I just installed Manjaro like 3 days ago and haven’t changed anything, so it’s brand new basically, it’s being used as a DHCP client.

Could you provide the output of (it will be a link to a pastebin) inside a code fence

inxi -Fc0 | curl -F 'f:=<-1' ix.io
http://ix.io/....

resumes from what

  • sleep - ram
  • hibernate - swap

What is the content of /etc/resolv.conf?

cat /etc/resolv.conf

As @cscs suggest - switching to systemd-resolved may solve your issue.