Networking

resolvectl 查詢失敗:“域”沒有任何請求類型的 RR

  • May 6, 2021

最近 systemd-resolved 無法解析大多數域並出現以下錯誤:

$ resolvectl query slashdot.org
slashdot.org: resolve call failed: 'slashdot.org' does not have any RR of the requested type

我目前已將我的配置減少到以下內容:

[Resolve]
DNS=1.1.1.1
$ resolvectl status
Global
          Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=allow-downgrade/unsupported
   resolv.conf mode: foreign
 Current DNS Server: 1.1.1.1
        DNS Servers: 1.1.1.1
Fallback DNS Servers: 1.1.1.1 8.8.8.8 1.0.0.1 8.8.4.4 2606:4700:4700::1111 2001:4860:4860::8888 2606:4700:4700::1001 2001:4860:4860::8844

我可以通過 dig 通過相同的 dns 服務解析名稱:

$ dig @1.1.1.1 slashdot.org

; <<>> DiG 9.16.11 <<>> @1.1.1.1 slashdot.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57735
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
slashdot.org.           262     IN      A       216.105.38.15

;; Query time: 20 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Wed Mar 31 10:33:43 CEST 2021
;; MSG SIZE  rcvd: 57

即使在我之後,它仍然以某種方式成功解析了一些域resolvectl flush-caches

$ resolvectl query stackexchange.com
stackexchange.com: 151.101.65.69               -- link: enp0s25
                  151.101.1.69                -- link: enp0s25
                  151.101.193.69              -- link: enp0s25

-- Information acquired via protocol DNS in 34.2ms.
-- Data is authenticated: no

我該如何解決這個問題?

更新

我查看了流量(第一次:resolvectl,第二次探勘):

20:29:53.540625 IP (tos 0x0, ttl 64, id 40410, offset 0, flags [DF], proto UDP (17), length 58)
   192.168.178.39.35819 > one.one.one.one.domain: [bad udp cksum 0x7509 -> 0x3c24!] 10838+% A? slashdot.org. (30)
20:29:53.558319 IP (tos 0x0, ttl 58, id 46858, offset 0, flags [DF], proto UDP (17), length 74)
   one.one.one.one.domain > 192.168.178.39.35819: [udp sum ok] 10838 q: A? slashdot.org. 1/0/0 slashdot.org. A 216.105.38.15 (46)
--
20:29:55.350287 IP (tos 0x0, ttl 64, id 40434, offset 0, flags [none], proto UDP (17), length 81)
   192.168.178.39.59104 > one.one.one.one.domain: [bad udp cksum 0x7520 -> 0x93a9!] 57704+ [1au] A? slashdot.org. ar: . OPT UDPsize=4096 [COOKIE e0f529ee021d164e] (53)
20:29:55.367233 IP (tos 0x0, ttl 58, id 57041, offset 0, flags [DF], proto UDP (17), length 85)
   one.one.one.one.domain > 192.168.178.39.59104: [udp sum ok] 57704 q: A? slashdot.org. 1/0/1 slashdot.org. A 216.105.38.15 ar: . OPT UDPsize=1232 (57)

resolvectl 設置 CD 位, dig 設置 AD(由伺服器清除)。除此之外,他們收到的響應基本相同。查詢stackexchange也是一樣,查詢成功。(雖然我很驚訝在通過 TLS 重新啟用 DNS 後仍然可以讀取流量,但 pcap 沒有顯示任何 tls 記錄。)

這是 systemd 中的一個錯誤,此後已修復。

引用自:https://unix.stackexchange.com/questions/642896