You are not logged in.

#1 2023-03-09 09:06:01

positronik
Member
Registered: 2016-02-08
Posts: 94

[SOLVED] DNS lookups time out

Hello,

I have this weird issue that I am not sure when it started.
Sometimes DNS lookups time out.

What happens can be seen from a simple dig and corresponding tcpdump reported below.
It seems like the computer sends a request, the UDP port where the request originated is closed  before the reply from the DNS arrives, and thus the PC has to send an additional request.

The problem persists with or without firewall on the originator.
The problem does not happen on MacOS and Win11.
The problem appears also if I use an external DNS server such as 1.1.1.1.

I am pasting my resolv.conf below.

xx@xx ~ % dig google.com
;; communications error to X.X.X.X#53: timed out

; <<>> DiG 9.18.12 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10971
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             65      IN      A       142.250.184.110

;; Query time: 16 msec
;; SERVER: X.X.X.X#53(192.168.11.7) (UDP)
;; WHEN: Thu Mar 09 09:45:13 CET 2023
;; MSG SIZE  rcvd: 55
xx@xx ~ % sudo tcpdump host 192.168.11.7 -v 
09:45:08.242121 IP (tos 0x0, ttl 64, id 2508, offset 0, flags [none], proto UDP (17), length 79)
    xx.53513 > pi.hole.domain: 10971+ [1au] A? google.com. (51)
09:45:13.246799 IP (tos 0x0, ttl 64, id 46344, offset 0, flags [none], proto UDP (17), length 79)
    xx.39863 > pi.hole.domain: 10971+ [1au] A? google.com. (51)
09:45:13.262248 IP (tos 0x0, ttl 64, id 35514, offset 0, flags [DF], proto UDP (17), length 83)
    pi.hole.domain > xx.53513: 10971 1/0/1 google.com. A 142.250.184.110 (55)
09:45:13.262294 IP (tos 0xc0, ttl 64, id 25224, offset 0, flags [none], proto ICMP (1), length 111)
    xx > pi.hole: ICMP xx udp port 53513 unreachable, length 91
        IP (tos 0x0, ttl 64, id 35514, offset 0, flags [DF], proto UDP (17), length 83)
    pi.hole.domain > xx.53513: 10971 1/0/1 google.com. A 142.250.184.110 (55)
09:45:13.262308 IP (tos 0x0, ttl 64, id 35515, offset 0, flags [DF], proto UDP (17), length 83)
    pi.hole.domain > xx.39863: 10971 1/0/1 google.com. A 142.250.184.110 (55)
xx@xx ~ % cat /etc/resolv.conf
domain local
search local
nameserver X.X.X.X

Last edited by positronik (2023-03-12 16:54:04)

Offline

#2 2023-03-12 07:11:16

seth
Member
Registered: 2012-09-03
Posts: 50,858

Re: [SOLVED] DNS lookups time out

The problem does not happen on MacOS and Win11.

Same machine? 3rd link below.

The problem appears also if I use an external DNS server such as 1.1.1.1.

Traffic still goes through the pi.hole?

If the response times in the segment are just that slow, see
https://wiki.archlinux.org/title/Domain … ookup_time
(obviously increase the timeout, defaults to 5, 30 is a hard limit)

Offline

#3 2023-03-12 10:34:46

positronik
Member
Registered: 2016-02-08
Posts: 94

Re: [SOLVED] DNS lookups time out

Actually, I think I've found the issue and it is not related to Arch.

At home I have an unmanaged switch that sends ethernet in every room. It seems that the switch is the problem.
I rebooted it and now it seems timeouts are gone.

Why it was working correctly for Win11 and MacOS?

MacOS: It was attached via wifi to the main router. As soon as I tried connecting to an AP put in cascade to the dumb switch, I got timeouts too.
Win11: I believe because it caches DNS requests, so the problem appears less often.

I think the "solution" is to reboot the switch every now and then, and setup a DNS cache like pdnsd on the Arch workstation.

Offline

#4 2023-03-12 11:48:16

seth
Member
Registered: 2012-09-03
Posts: 50,858

Re: [SOLVED] DNS lookups time out

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB