You are not logged in.

#1 2016-12-19 11:55:45

svdb
Member
Registered: 2016-12-19
Posts: 2

[Solved] DNS problem after wake from suspend

I can't ping, ssh or use pacaur to download updates after opening my laptop after it's been suspended. I use NetworkManager and dhcpcd. The laptop is a ThinkPad x220. Other than iptables, whose rules I flushed with $ sudo iptables -F, I have no firewalls running. After a reboot the ping command works again, but as soon as I hibernate the laptop and wake it back up, pinging (and ssh/pacaur) doesn't work anymore. I can still visit websites normally. I use XFCE as a window manager, and TLP to manage power settings.

Reloading the services NetworkManager, dhcpcd doesn't change anything, nor does reconnecting to WiFi using nm-applet.

$ ping www.google.com
ping: www.google.com: Name or service not known

$ pacaur -Syyu
...
error: failed retrieving file 'core.db' from ftp.heanet.ie : Could not resolve host: ftp.heanet.ie
...

System information:

$ uname -a
Linux x220 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 07:24:34 CET 2016 x86_64 GNU/Linux

$ lspci -vv -s 03:00.0
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)
        Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 36
        Region 0: Memory at f1500000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: <access denied>
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

Journal output: link.
/etc/default/tlp: link.

$ systemctl status NetworkManager
● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2016-12-19 11:30:44 CET; 1h 0min ago
     Docs: man:NetworkManager(8)
 Main PID: 1077 (NetworkManager)
    Tasks: 3 (limit: 4915)
   Memory: 16.2M
      CPU: 1.841s
   CGroup: /system.slice/NetworkManager.service
           └─1077 /usr/bin/NetworkManager --no-daemon

Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.3863] dhcp4 (wlan0):   ntp server '192.168.178.1'
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.3869] dhcp4 (wlan0): state changed unknown -> bound
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.3921] device (wlan0): state change: ip-config -> ip-check (reason 'none') [70 80 0]
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.4218] device (wlan0): state change: ip-check -> secondaries (reason 'none') [80 90 0]
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.4223] device (wlan0): state change: secondaries -> activated (reason 'none') [90 100 0]
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.4226] manager: NetworkManager state is now CONNECTED_LOCAL
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.4420] manager: NetworkManager state is now CONNECTED_GLOBAL
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.4422] policy: set 'Palmenallee_RPT' (wlan0) as default for IPv4 routing and DNS
Dec 19 12:03:57 x220 NetworkManager[1077]: <info>  [1482145437.4425] device (wlan0): Activation: successful, device activated.
Dec 19 12:03:58 x220 NetworkManager[1077]: <info>  [1482145438.8936] policy: set 'Palmenallee_RPT' (wlan0) as default for IPv6 routing and DNS

$ systemctl status dhcpcd@wlan0
● dhcpcd@wlan0.service - dhcpcd on wlan0
   Loaded: loaded (/usr/lib/systemd/system/dhcpcd@.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2016-12-19 11:47:40 CET; 20min ago
 Main PID: 7983 (dhcpcd)
   CGroup: /system.slice/system-dhcpcd.slice/dhcpcd@wlan0.service
           └─7983 /usr/bin/dhcpcd -q -w wlan0

Dec 19 12:03:57 x220 dhcpcd[7983]: wlan0: soliciting an IPv6 router
Dec 19 12:03:57 x220 dhcpcd[7983]: wlan0: probing address 192.168.178.122/24
Dec 19 12:03:58 x220 dhcpcd[7983]: wlan0: Router Advertisement from fe80::be05:43ff:fe90:430a
Dec 19 12:03:58 x220 dhcpcd[7983]: wlan0: adding address 2003:c1:13c4:2000:bc61:aca9:efff:ff3/64
Dec 19 12:03:58 x220 dhcpcd[7983]: wlan0: adding route to 2003:c1:13c4:2000::/64
Dec 19 12:03:58 x220 dhcpcd[7983]: wlan0: adding default route via fe80::be05:43ff:fe90:430a
Dec 19 12:03:58 x220 dhcpcd[7983]: wlan0: requesting DHCPv6 information
Dec 19 12:04:02 x220 dhcpcd[7983]: wlan0: leased 192.168.178.122 for 864000 seconds
Dec 19 12:04:02 x220 dhcpcd[7983]: wlan0: adding route to 192.168.178.0/24
Dec 19 12:04:02 x220 dhcpcd[7983]: wlan0: adding default route via 192.168.178.1

$ ping www.google.com
ping: www.google.com: Name or service not known

$ pacaur -Syyu
...
error: failed retrieving file 'core.db' from ftp.heanet.ie : Could not resolve host: ftp.heanet.ie
...

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DOCKER-ISOLATION  all  --  anywhere             anywhere
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain DOCKER (1 references)
target     prot opt source               destination

Chain DOCKER-ISOLATION (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

$ cat /etc/dhcpcd.conf | tail

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
noipv4ll

# Protect /etc/resolv.conf from dhcpcd
nohook resolv.conf

# Static DNS
# static domain_name_servers=8.8.8.8 8.8.4.4

$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 32 2016-12-18 23:11 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf

$ cat /etc/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known DNS servers.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
# Too many DNS servers configured, the following entries may be ignored.
nameserver 2001:4860:4860::8844

$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       localhost.localdomain   localhost
::1             localhost.localdomain   localhost
x220            localhost.localdomain   localhost

# End of file

$ cat /etc/nsswitch.conf
# Begin /etc/nsswitch.conf

passwd: compat mymachines systemd
group: compat mymachines systemd
shadow: compat

publickey: files

hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

# End /etc/nsswitch.conf

$ tree /etc/systemd/system/
/etc/systemd/system/
├── [4.0K]  basic.target.wants/
├── [4.0K]  getty.target.wants/
│   └── [  38]  getty@tty1.service -> /usr/lib/systemd/system/getty@.service
├── [4.0K]  getty@tty1.service.d/
│   └── [  30]  noclear.conf
├── [4.0K]  multi-user.target.wants/
│   ├── [  39]  dhcpcd@wlan0.service -> /usr/lib/systemd/system/dhcpcd@.service
│   ├── [  38]  docker.service -> /usr/lib/systemd/system/docker.service
│   ├── [  40]  iptables.service -> /usr/lib/systemd/system/iptables.service
│   ├── [  46]  NetworkManager.service -> /usr/lib/systemd/system/NetworkManager.service
│   ├── [  40]  remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
│   ├── [  48]  systemd-networkd.service -> /usr/lib/systemd/system/systemd-networkd.service
│   ├── [  48]  systemd-resolved.service -> /usr/lib/systemd/system/systemd-resolved.service
│   ├── [  35]  tlp.service -> /usr/lib/systemd/system/tlp.service
│   └── [  39]  xboxdrv.service -> /usr/lib/systemd/system/xboxdrv.service
├── [4.0K]  sleep.target.wants/
│   └── [  41]  tlp-sleep.service -> /usr/lib/systemd/system/tlp-sleep.service
├── [4.0K]  sockets.target.wants/
│   └── [  47]  systemd-networkd.socket -> /usr/lib/systemd/system/systemd-networkd.socket
├── [4.0K]  sysinit.target.wants/
│   └── [  49]  systemd-timesyncd.service -> /usr/lib/systemd/system/systemd-timesyncd.service
├── [4.0K]  timers.target.wants/
│   └── [  41]  rsnapshot-daily.timer -> /etc/systemd/system/rsnapshot-daily.timer
├── [  46]  dbus-org.freedesktop.NetworkManager.service -> /usr/lib/systemd/system/NetworkManager.service
├── [  57]  dbus-org.freedesktop.nm-dispatcher.service -> /usr/lib/systemd/system/NetworkManager-dispatcher.service
├── [ 190]  rsnapshot-daily.timer
└── [ 125]  rsnapshot@.service

8 directories, 19 files

$ systemctl cat tlp
# /usr/lib/systemd/system/tlp.service
# tlp - systemd startup/shutdown service
#
# Copyright (c) 2016 Thomas Koch <linrunner at gmx.net>
# This software is licensed under the GPL v2 or later.

[Unit]
Description=TLP system startup/shutdown
Wants=bluetooth.service NetworkManager.service
After=multi-user.target bluetooth.service NetworkManager.service
Before=shutdown.target
Documentation=http://linrunner.de/tlp

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/tlp init start
ExecStop=/usr/bin/tlp init stop

[Install]
WantedBy=multi-user.target

$ systemctl cat tlp-sleep
# /usr/lib/systemd/system/tlp-sleep.service
# tlp - systemd suspend/resume service
#
# Copyright (c) 2016 Thomas Koch <linrunner at gmx.net>
# This software is licensed under the GPL v2 or later.

[Unit]
Description=TLP suspend/resume
Before=sleep.target
StopWhenUnneeded=yes
Documentation=http://linrunner.de/tlp

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/tlp suspend
ExecStop=/usr/bin/tlp resume

[Install]
WantedBy=sleep.target

$ systemctl cat systemd-networkd
# /usr/lib/systemd/system/systemd-networkd.service
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Network Service
Documentation=man:systemd-networkd.service(8)
ConditionCapability=CAP_NET_ADMIN
DefaultDependencies=no
# dbus.service can be dropped once on kdbus, and systemd-udevd.service can be
# dropped once tuntap is moved to netlink
After=systemd-udevd.service dbus.service network-pre.target systemd-sysusers.service systemd-sysctl.service
Before=network.target multi-user.target shutdown.target
Conflicts=shutdown.target
Wants=network.target

# On kdbus systems we pull in the busname explicitly, because it
# carries policy that allows the daemon to acquire its name.
Wants=org.freedesktop.network1.busname
After=org.freedesktop.network1.busname

[Service]
Type=notify
Restart=on-failure
RestartSec=0
ExecStart=/usr/lib/systemd/systemd-networkd
WatchdogSec=3min
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_D
ProtectSystem=full
ProtectHome=yes
ProtectControlGroups=yes
MemoryDenyWriteExecute=yes
RestrictRealtime=yes
RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 AF_PACKET
SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io

[Install]
WantedBy=multi-user.target
Also=systemd-networkd.socket

$ systemctl cat systemd-resolved
# /usr/lib/systemd/system/systemd-resolved.service
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Network Name Resolution
Documentation=man:systemd-resolved.service(8)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/resolved
Documentation=http://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
Documentation=http://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
After=systemd-networkd.service network.target

# On kdbus systems we pull in the busname explicitly, because it
# carries policy that allows the daemon to acquire its name.
Wants=org.freedesktop.resolve1.busname
After=org.freedesktop.resolve1.busname

[Service]
Type=notify
Restart=always
RestartSec=0
ExecStart=/usr/lib/systemd/systemd-resolved
WatchdogSec=3min
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_NET_RAW CAP_NET_BIND_SERVICE
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
ProtectControlGroups=yes
ProtectKernelTunables=yes
MemoryDenyWriteExecute=yes
RestrictRealtime=yes
RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6
SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io

[Install]
WantedBy=multi-user.target

$ systemctl cat NetworkManager
# /usr/lib/systemd/system/NetworkManager.service
[Unit]
Description=Network Manager
Documentation=man:NetworkManager(8)
Wants=network.target
After=network-pre.target dbus.service
Before=network.target

[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
#ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkM
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/bin/NetworkManager --no-daemon
Restart=on-failure
# NM doesn't want systemd to kill its children for it
KillMode=process
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRI

# ibft settings plugin calls iscsiadm which needs CAP_SYS_ADMIN
#CapabilityBoundingSet=CAP_SYS_ADMIN

ProtectSystem=true
ProtectHome=read-only

[Install]
WantedBy=multi-user.target
Alias=dbus-org.freedesktop.NetworkManager.service
Also=NetworkManager-dispatcher.service

$ systemd-resolve --status
Global
         DNS Servers: 8.8.8.8
                      8.8.4.4
                      2001:4860:4860::8888
                      2001:4860:4860::8844
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 4 (docker0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (wlan0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (eth0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

$ sudo systemd-resolve --flush-caches

$ ping www.google.com
ping: www.google.com: Name or service not known

Last edited by svdb (2016-12-19 17:14:02)

Offline

#2 2016-12-19 16:20:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 79,182

Re: [Solved] DNS problem after wake from suspend

I use NetworkManager and dhcpcd.

And that's most likely the source of your problems. Pick *one* network managing path.
In doubt, post your services

systemctl list-units | grep -iE '(net|dhcp)'

Offline

#3 2016-12-19 17:13:45

svdb
Member
Registered: 2016-12-19
Posts: 2

Re: [Solved] DNS problem after wake from suspend

After removing dhcpcd, everything worked normally again. I'm just using NetworkManager now and it works great. I was under the impression that dhcpcd was required for name resolution, but that's not the case. Thanks!

Offline

Board footer

Powered by FluxBB