I have been suffering a 5-10 second lag from EVERY connection in a new browser tab, or a curl request. I have found out on the Internet that I should disable IPv6. But when I disabled IPv6 the Chrome tabs started loading instantly but my terminal commands that connect to the internet still suffer from that lag.
I am using Manjaro Linux 23.0.2
Here are the smallest examples I can show you:
curl
$ time curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
curl google.com 0,00s user 0,01s system 0% cpu 5,283 total
ping (first line is printed after 5 seconds)
$ time ping -c 5 google.com
PING google.com (142.250.184.142) 56(84) bytes of data.
64 bytes from sof02s43-in-f14.1e100.net (142.250.184.142): icmp_seq=1 ttl=55 time=9.70 ms
64 bytes from sof02s43-in-f14.1e100.net (142.250.184.142): icmp_seq=2 ttl=55 time=12.3 ms
64 bytes from sof02s43-in-f14.1e100.net (142.250.184.142): icmp_seq=3 ttl=55 time=14.4 ms
64 bytes from sof02s43-in-f14.1e100.net (142.250.184.142): icmp_seq=4 ttl=55 time=9.86 ms
64 bytes from sof02s43-in-f14.1e100.net (142.250.184.142): icmp_seq=5 ttl=55 time=11.2 ms
--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 9.696/11.495/14.419/1.746 ms
ping -c 5 google.com 0,01s user 0,00s system 0% cpu 9,043 total
But this command is very fast:
$ time nslookup google.com
Server: 1.1.1.1
Address: 1.1.1.1#53
Non-authoritative answer:
Name: google.com
Address: 142.250.184.142
Name: google.com
Address: 2a00:1450:4017:814::200e
nslookup google.com 0,01s user 0,03s system 22% cpu 0,147 total
Things i have tried:
- changed my dns servers to cloudflare and google (in Wi-Fi settings)
- disabled ipv6
The question is how can I diagnose the problem? And if possible, how can I solve it?
scutil --dns
.