Ping takes 20s to start

I think you are mistaking how ping works - ping works by telling you how fast the ICMP packet is returning to your system. Depending on a lot of factors this will vary - a lot.

Ping is telling you if there is a route to the host or not.

Example - using the barnesandnoble.com from above

Pinging the domain without www - and I am getting no response - and as you can see there was no issue looking up the IP - theres is just no service responding on the IP address.

➜  ~ resolvectl flush-caches
➜  ~ ping barnesandnoble.com
PING barnesandnoble.com (161.221.74.213) 56(84) bytes of data.
^C
--- barnesandnoble.com ping statistics ---
72 packets transmitted, 0 received, 100% packet loss, time 71942ms

Pinging the domain with www

➜  ~ ping www.barnesandnoble.com
PING e4658.a.akamaiedge.net (23.77.250.226) 56(84) bytes of data.
64 bytes from a23-77-250-226.deploy.static.akamaitechnologies.com (23.77.250.226): icmp_seq=1 ttl=56 time=3.64 ms
64 bytes from a23-77-250-226.deploy.static.akamaitechnologies.com (23.77.250.226): icmp_seq=2 ttl=56 time=3.45 ms
64 bytes from a23-77-250-226.deploy.static.akamaitechnologies.com (23.77.250.226): icmp_seq=3 ttl=56 time=3.52 ms
64 bytes from a23-77-250-226.deploy.static.akamaitechnologies.com (23.77.250.226): icmp_seq=4 ttl=56 time=3.48 ms
64 bytes from a23-77-250-226.deploy.static.akamaitechnologies.com (23.77.250.226): icmp_seq=5 ttl=56 time=3.50 ms
^C
--- e4658.a.akamaiedge.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 3.451/3.516/3.639/0.065 ms

Fair enough - at least it told you the IP address. In my case I get no response from ping. Nothing for 20 seconds. Whether I input www or not. It literally hangs. and as I said websites take 20 seconds or more to connect. www.Amazon.com, www.google.com, anything.

My system is on Manjaro and using systemd-resolved. Just this morning I had a severe connection issue - but that was my ISP having a breakdown.

➜  ~ inxi -Sxxx              
System:
  Host: ts Kernel: 5.14.3-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 
  Desktop:  info: tint2 wm: Openbox 3.6.1 vt: 1 dm: LightDM, SDDM 
  Distro: Manjaro Linux base: Arch Linux 

I think you should look at the network card and the drivers used.

inxi -Nxxx

After booting into the live USB and trying ping (Ctrl-C after 10 seconds) and then running inxi -

[manjaro@manjaro ~]$ ping www.google.com
^C
[manjaro@manjaro ~]$ inxi -Nxxx
Network: Device-1: Intel 82579LM Gigabit Network vendor: Lenovo ThinkPad T520 driver: e1000e v: 3.2.6-k port: 6080
bus ID: 00:19.0 chip ID: 8086:1502
Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi v: kernel port: 5000 bus ID: 03:00.0
chip ID: 8086:0085
[manjaro@manjaro ~]$

A wild guess - you could check the settings of your router’s wifi access point - try switching channels for the 2.4 maybe the AP is using the same name for 2.4GHz and 5GHz and your laptop’s wifi card gets confused - or the 2.4GHz channel is crowded because you are in an area with a lot of 2.4GHz wi-fi APs.

You can use the package linssid to see how crowded your area is.

I just tried booting into a live Linux Mint USB and I can confirm the same problem is present there as well - whether I use my 5GHz channel or the 2.4GHz (which have different names). So clearly it is not specific to Manjaro but just something that is happening with multiple Linux distros but not with Windoze. I shudder to think of the consequences.
Edit: However in the live distro the connects happen quickly when connecting to my phone’s hotspot. So this is an issue specific to Linux trying to access my router. Not sure if this offers some clues. Many thanks for the continued efforts to help!!

The device is approx. 10 years and it should be supported by the kernel.

But a regression maybe?

Which kernel is currently running?

mhwd-kernel -li

Try disabling one of the bands in the router or renaming one of the SSID

E.g. if the SSID is name fido then rename the 5G to fido-5g and restart your router.

When you connect there will be no confusion for the system.

It could be the system is polling back and forth between 2.5 and 5 because the names are identical.

[manjaro@manjaro ~]$ mhwd-kernel -li
Currently running: 5.6.15-1-MANJARO (linux56)
The following kernels are installed in your system:
warning: database file for ‘core’ does not exist (use ‘-Sy’ to download)
warning: database file for ‘extra’ does not exist (use ‘-Sy’ to download)
warning: database file for ‘community’ does not exist (use ‘-Sy’ to download)
warning: database file for ‘multilib’ does not exist (use ‘-Sy’ to download)

  • linux56
    warning: database file for ‘core’ does not exist (use ‘-Sy’ to download)
    warning: database file for ‘extra’ does not exist (use ‘-Sy’ to download)
    warning: database file for ‘community’ does not exist (use ‘-Sy’ to download)
    warning: database file for ‘multilib’ does not exist (use ‘-Sy’ to download)
    [manjaro@manjaro ~]$

Tried changing the SSID no effect.

kernel 5.6 is EOL and does not receive any maintenance.

I recommend you connect your laptop using Ethernet then run a full system update and in that process install the latest LTS kernel 5.10.

Refresh your mirror list

sudo pacman-mirrors --continent

Then sync and include linux510

sudo pacman -Syyu linux510

My base system is indeed already on 5.10. I just tried booting from an older live USB, that’s all. So that is not the issue. Anyhow, I need to revert to openresolv as the switch to systemd-resolved that I tried earlier today seems to have considerably worsened things. How do I revert? Thank you.

Just reverse the steps - stop and disable the systemd-resolved - remove the symlink and move the resolv.conf.bak to resolv.conf

Thanks. The “lookup delay” had gone to well over 2 minutes, reverting to openresolv has brought it back to about 20s.

It’s probably a dead end here I know, but here’s one last nugget of info just in case it helps. Once I open a browser and access, say, google.com, I can then access new sites (tried gardendesign.com which I have never accessed before) and they open in 1-3 seconds. But if I close all browser windows, open a fresh instance then I am back to a 20s wait.

If this was a common issue - there would be 100s of issues but this is not the case.

I am running several computers using Manjaro - thousands of users is running Manjaro - even one of my servers is running Manjaro.

I am therefore convinced it is an issue local to your environment - and as you noted in your OT the issue has appeared after your ISP replaced your router.

If you connect the laptop using cable to your router does the issue persist?

If not you have narrowed it down to the wireless connection.

I suspect this is a router issue - there must be something with the routers AP - as you have confirmed.

Yes I completely agree with a qualification - it is an issue with the combination of Linux and router, since there is no issue with router+ Windoze or router + Android (I tried pinging from a terminal on my Pixel 2 XL phone and it was instant). So I can’t complain to the ISP either. Very frustrating! But my profuse thanks to you, @linux-aarhus and @cfinnberg for your selfless attempts to help. I will definitely post the solution here when I find it. I have posted this problem on the Unix/Linux stackexchange forums hoping some networking geek can get to it.

1 Like

Have you tried disabling ipv6 completely via grub?

I though that topic will be 2-3 post long with “that’s why” as solution and “thank u” posts.
But such a long story!
Thanks to all participants and readers!

Let’s continue the saga of that ping issue? We will even write to Torwalds in case we can’t solve it. :grinning:

OK, summarizing:

I agree with author:

It is not WiFi/Ethernet issue, it is DNS only related.

So, are you using DHCP or static IP conf?

Did you tried to change external DNS requests gathering from the router to your local (to add 1.1.1.1 DNS into your OS as the only DNS your ManjaroOS uses and rejecting the usage of DNS casting by the router?

Linux Mint, Manjaro, Manjaro LiveCD can’t, but Windows can.

Probably DSN uses several protocol’s or/and ports to resolve host name into IP addresses.
My Manjaro OS copy components and my apps uses UDP, port 53 as the only ability to resolve host names.
What’s the DSN algorithm? May be for some reason that protocol and port is blocked in your router, and after that 20s delay Manjaro start to use other protocol-port combination to try and than it is success. Or only second resolve request (may be it goes after 20s delay) wakes up the router’s DNS answers.

May be Windows spams/attacks DNS with several request into several protocol/port combinations or sends it as couple at once or after a tiny delay.

You can monitor your traffic on Manjaro Linux machine with a network connection monitor or as firewall component (opensnitch AUR package).

Do you have the latest firmware version installed on your router?

Also be aware, that a Chromium-based browser (at least) could use the `https` protocol for DNS requests

So big app (such as browsers and may be Windows OS also) work can mislead you in diagnostic the root of issue, as it is complex tool targeted to reach some purpose, not just low-level target/event, and can be not cute/accurate enough to easily understand how it did somewhat. Linux probably more cute and accurate and acts closer to specifications and user configs and do not spams with simultaneously several requests or not doubling requests, which can eliminate/light up obvious problems in a network configuration, without trying all possible ways at once on every DNS request.
PS: it is not the exact statement, just thoughts based on my current development / knowledge / experience level (but which is not high).

Try echo "options single-request-reopen" | sudo tee -a /etc/resolv.conf