You are not logged in.

#1 2023-10-16 16:53:28

softmoth
Member
Registered: 2016-06-30
Posts: 3

firefox command delay of 24 seconds when VPN connected

Hello! I am using the PIA VPN service. When it is connected, the firefox command takes 24 seconds. According to strace, it's trying to resolve the name of my local IP (192.168.11.111, presently):

...
     0.000026 socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 14
     0.000032 connect(14, {sa_family=AF_UNIX, sun_path="/run/systemd/resolve/io.systemd.Resolve"}, 42) = 0
     0.000051 clock_gettime(CLOCK_MONOTONIC, {tv_sec=135654, tv_nsec=180969101}) = 0
     0.000034 sendto(14, "{\"method\":\"io.systemd.Resolve.ResolveHostname\",\"parameters\":{\"name\":\"jelly\",\"family\":2,\"flags\":0}}\0", 99, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 99
     0.000047 clock_gettime(CLOCK_MONOTONIC, {tv_sec=135654, tv_nsec=181049558}) = 0
     0.000035 recvfrom(14, 0x7f0c4cc66000, 131072, MSG_DONTWAIT, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
     0.000032 clock_gettime(CLOCK_MONOTONIC, {tv_sec=135654, tv_nsec=181117723}) = 0
     0.000034 clock_gettime(CLOCK_MONOTONIC, {tv_sec=135654, tv_nsec=181152923}) = 0
     0.000033 ppoll([{fd=14, events=POLLIN}], 1, {tv_sec=119, tv_nsec=999897000}, NULL, 8) = 1 ([{fd=14, revents=POLLIN}], left {tv_sec=95, tv_nsec=671054868})
    24.328965 recvfrom(14, "{\"parameters\":{\"addresses\":[{\"ifindex\":4,\"family\":2,\"address\":[192,168,11,111]},{\"ifindex\":18,\"family\":2,\"address\":[10,8,18,107]}],\"name\":\"jelly\",\"flags\":786945}}\0", 131072, MSG_DONTWAIT, NULL, NULL) = 163
     0.000153 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
     0.000111 close(14)                 = 0
...

Indeed, this times out when trying with dig:

trs jelly:~ [5149]% dig 192.168.11.1
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out

; <<>> DiG 9.18.19 <<>> 192.168.11.1
;; global options: +cmd
;; no servers could be reached

And returns instantly if the VPN is disconnected:

trs jelly:~ [5150:9]% dig 192.168.11.1
; <<>> DiG 9.18.19 <<>> 192.168.11.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27442
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;192.168.11.1.                  IN      A

;; AUTHORITY SECTION:
.                       86400   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2023101600 1800 900 604800 86400

;; Query time: 73 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Mon Oct 16 12:47:23 EDT 2023
;; MSG SIZE  rcvd: 116

I assume I've got systemd-resolved misconfigured or something. But name resolution is working fine otherwise. I mean, `dig mozilla.org` and it instantly returns the correct response. If I /etc/resolv.conf points to /run/systemd/resolve/stub-resolv.conf, which contains:

nameserver 127.0.0.53
options edns0 trust-ad
search home

What am I missing? Thanks!

Tim

Offline

#2 2023-10-16 19:11:56

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

Re: firefox command delay of 24 seconds when VPN connected

25s is the dbus timeout, that's gonna be system-resolved through libresolve, not DNS.
Does it respond *at all* under this condition?

resolvectl status

Offline

#3 2023-10-19 18:37:05

softmoth
Member
Registered: 2016-06-30
Posts: 3

Re: firefox command delay of 24 seconds when VPN connected

Thanks! Yes, it does respond instantly. Maybe it's something to do with IPv6, which I think PIA VPN doesn't support? See:

trs jelly:~ [4102]% time resolvectl status
Global
           Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: stub
  Current DNS Server: 1.0.0.1
         DNS Servers: 1.1.1.1 1.0.0.1 192.168.11.1
Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google
                      2606:4700:4700::1111#cloudflare-dns.com 2620:fe::9#dns.quad9.net
                      2001:4860:4860::8888#dns.google
          DNS Domain: home ~.

Link 2 (eno1)
    Current Scopes: none
         Protocols: -DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 6 (wlan0)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.0.1
       DNS Servers: 192.168.0.1 8.8.4.4 192.168.11.1

Link 14 (tun0)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6 mDNS/IPv4 mDNS/IPv6
         Protocols: +DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 10.0.0.243
       DNS Servers: 10.0.0.243
        DNS Domain: ~.
resolvectl status  0.01s user 0.00s system 51% cpu 0.019 total

Offline

#4 2023-10-19 19:45:14

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

Re: firefox command delay of 24 seconds when VPN connected

That would be easy enough to test by disabling it, https://wiki.archlinux.org/title/IPv6#Disable_IPv6

Offline

#5 2023-10-19 20:05:47

softmoth
Member
Registered: 2016-06-30
Posts: 3

Re: firefox command delay of 24 seconds when VPN connected

Something odd just appeared. Since /etc/resolv.conf shows nameserver 127.0.0.53, I tried querying that explicitly. I expected it to time out, since that's what I'm seeing when I just use dig -x 192.168.11.109. And most times it does just time out. But one time I got a correct response back from it! And then when trying again immediately after, it timed out again.

What could cause it to occasionally work, but usually time out???

trs jelly:~ [4124]% ping 127.0.0.53
PING 127.0.0.53 (127.0.0.53) 56(84) bytes of data.
64 bytes from 127.0.0.53: icmp_seq=1 ttl=64 time=0.035 ms
64 bytes from 127.0.0.53: icmp_seq=2 ttl=64 time=0.068 ms
^C
--- 127.0.0.53 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.035/0.051/0.068/0.016 ms

Obviously, there's no problem pinging the host, since it's just localhost....

trs jelly:~ [4125:130]% dig -x 192.168.11.109 @127.0.0.53
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out

; <<>> DiG 9.18.19 <<>> -x 192.168.11.109 @127.0.0.53
;; global options: +cmd
;; no servers could be reached

One timeout. But then....:

trs jelly:~ [4126:9]% time dig -x 192.168.11.109 @127.0.0.53

; <<>> DiG 9.18.19 <<>> -x 192.168.11.109 @127.0.0.53
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25420
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;109.11.168.192.in-addr.arpa.   IN      PTR

;; ANSWER SECTION:
109.11.168.192.in-addr.arpa. 0  IN      PTR     jelly.
109.11.168.192.in-addr.arpa. 0  IN      PTR     jelly.local.

;; Query time: 2899 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Oct 19 15:56:17 EDT 2023
;; MSG SIZE  rcvd: 100

dig -x 192.168.11.109 @127.0.0.53  0.01s user 0.00s system 0% cpu 2.923 total

It worked! It took a while (2.9 seconds), but it did work! How did it work? Why is it so slow?

trs jelly:~ [4127]% time dig -x 192.168.11.109 @127.0.0.53
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out

; <<>> DiG 9.18.19 <<>> -x 192.168.11.109 @127.0.0.53
;; global options: +cmd
;; no servers could be reached

dig -x 192.168.11.109 @127.0.0.53  0.00s user 0.01s system 0% cpu 15.038 total
trs jelly:~ [4127:9]% time dig -x 192.168.11.109 @127.0.0.53
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out

; <<>> DiG 9.18.19 <<>> -x 192.168.11.109 @127.0.0.53
;; global options: +cmd
;; no servers could be reached

dig -x 192.168.11.109 @127.0.0.53  0.01s user 0.00s system 0% cpu 15.034 total

And I couldn't get it to work again. If it hadn't been for that one fluke success, I would have thought it was never working....

Thanks again for any insights you might provide!

Offline

#6 2023-10-19 20:09:05

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

Re: firefox command delay of 24 seconds when VPN connected

127.0.0.53#53 is resolved, inspect the system journal on whether is yells errors or maybe crash-restarts

Offline

Board footer

Powered by FluxBB