You are not logged in.

#1 2022-06-18 14:32:17

arture
Member
Registered: 2021-08-09
Posts: 7

[SOLVED] DNS Error when reconnecting to the Internet

Hello everyone!

I have recently changed the package I use to connect to the wifi on my laptop. I used to have iwd, and now I use NetworkManager. However, It comes with a problem that I can't seem to be able to solve :

Whenever I get disconnected and reconnected to the Internet, be it because I close my laptop, or I restart my router, etc... some websites stop being accessible.
I can still google, some websites still work, but for most of them, I get an error. The error is different depending on the browser I use :
- Firefox gives me : 'Server not found'
- Chrome gives me : 'server IP address could not be found.'
- Brave gives me : 'server DNS address could not be found.'

I suspect this is a DNS server error, but I don't understand why it would work at the start to stop working later.
I have tried to restart NetworkManager.service, but it does not help. I am forced to reboot everytime this happens.

Note : Weirdly, when I change the hotspot I am connected to via NetworkManager, it still works the first time :

For instance, if I am connected to Hotspot 1 and my connection works, and then I use nmtui to connect to Hotspot 2, I still have access to all websites. But if I change back to Hotspot 1, I get  the error.

To be fair, I don't really understand how a DNS server works, but I'm hoping someone has a solution.

I hope I was clear enough, thank you for reading.

Last edited by arture (2022-06-22 19:31:23)

Offline

#2 2022-06-18 15:30:01

seth
Member
Registered: 2012-09-03
Posts: 59,410

Re: [SOLVED] DNS Error when reconnecting to the Internet

Check whether you fall into https://bbs.archlinux.org/viewtopic.php?id=276276

Also, sanity check:

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Offline

#3 2022-06-20 10:41:17

arture
Member
Registered: 2021-08-09
Posts: 7

Re: [SOLVED] DNS Error when reconnecting to the Internet

Thank you,
I checked the thread you mentioned and it does not seem to be my issue. Whenever I have a problem, my resolv.conf is empty, save for the line

# Generated by NetworkManager

Instead of having unnecessary lines.

I ran the command you gave, and I get this :

dbus-org.freedesktop.nm-dispatcher.service | system
dirmngr.socket                           | sockets.target.wants
getty@tty1.service                       | getty.target.wants
gpg-agent-browser.socket                 | sockets.target.wants
gpg-agent-extra.socket                   | sockets.target.wants
gpg-agent.socket                         | sockets.target.wants
gpg-agent-ssh.socket                     | sockets.target.wants
NetworkManager.service                   | multi-user.target.wants
NetworkManager-wait-online.service       | network-online.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire.socket                          | sockets.target.wants
pulseaudio.socket                        | sockets.target.wants
remote-fs.target                         | multi-user.target.wants

Offline

#4 2022-06-20 13:32:13

seth
Member
Registered: 2012-09-03
Posts: 59,410

Re: [SOLVED] DNS Error when reconnecting to the Internet

Whenever I get disconnected and reconnected to the Internet, be it because I close my laptop, or I restart my router

Can you then still

ping 8.8.8.8

You're either not getting a re-lease or DNS server via dhcp.
Post a system journal that covers the event ("sudo journalctl -b -1" for the previous boot. Don't copy out of the pager. Redirect the output into a file or a pastebin service, see 1st link below on the latter)

Offline

#5 2022-06-20 15:58:30

arture
Member
Registered: 2021-08-09
Posts: 7

Re: [SOLVED] DNS Error when reconnecting to the Internet

- No, I can't ping 8.8.8.8

- Here's the pastebin link : https://pastebin.com/uYDVbvdr

Offline

#6 2022-06-20 21:03:54

seth
Member
Registered: 2012-09-03
Posts: 59,410

Re: [SOLVED] DNS Error when reconnecting to the Internet

You do get leases after each sleep/resume.
Output of "ip a; ip r" when waking up to a "broken" network?

There's some noise w/ NM controlling dhcpcd - is there a particular reason for you using dhcpcd as backend and do ho have the same problems when using the NM built-in dhcp client?

Offline

#7 2022-06-22 19:30:33

arture
Member
Registered: 2021-08-09
Posts: 7

Re: [SOLVED] DNS Error when reconnecting to the Internet

Okay, so I've switched back to the built-in dhcp client, and I haven't run into any problems in the last two days. So I'm guessing that was it, thank you.
Although I'm not sure what was the problem.

For completeness, here's the output of "ip a; ip r" when the network is broken :

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 30:65:ec:b9:a0:d8 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 58:00:e3:72:6a:61 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fec6:3b6c:6c7f:f9b4/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Anyway, I'll change this post to solved, thank you for your help.

Offline

#8 2022-06-22 20:09:44

seth
Member
Registered: 2012-09-03
Posts: 59,410

Re: [SOLVED] DNS Error when reconnecting to the Internet

Either NM has trouble controlling dhcpcd or dhcpcd doesn't play ball w/ the dhcp server - for a wild guess, you could try to switch from duid to clientid in /etc/dhcpcd.conf

Offline

Board footer

Powered by FluxBB