Repository navigation
Description
systemd version the issue has been seen with
systemd-239-6.git9f3aed1.fc29.x86_64
Used distribution
Fedora 29
Expected behaviour you didn't see
When queried for the AAAA record of the magic host
_gatewayon an IPv4-only host, the question should have been answered with aNODATAstatus (a.k.a.NOERRORwith zero answers), as there exists records with different RR types for the queried-for FQDN. Conversely, when queried for the A record of_gatewayon an IPv6-only host, the question should also have been answered withNODATA.
Unexpected behaviour you saw
The queries mentioned above are answered with
NXDOMAIN.NXDOMAINis a status code that indicates to the client that the FQDN does not exist at all (i.e., regardless of the RR type). In other words, a client querying for theAAAArecord of_gatewayand getting anNXDOMAINanswer may safely assume that this FQDN does not have anArecord (orTXTor any other for that matter) either, and can optimise away any planned queries for those records. This bug means that such a client that queries for_gatewaymight end up with incorrect information (e.g., incorrectly concluding that «this host has no gateways at all»).
Steps to reproduce the problem
Start out with an IPv4-only or IPv6-only machine, e.g., like so:
$ ip -4 route show default
default via 192.168.1.1 dev wlp2s0 proto dhcp metric 600
$ ip -6 route show default | wc -l
0Perform some queries for the magic _gateway FQDN:
$ dig @127.0.0.53 _gateway. IN A
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-10.P2.fc29 <<>> @127.0.0.53 _gateway. IN A
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51151
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;_gateway. IN A
;; ANSWER SECTION:
_gateway. 0 IN A 192.168.1.1
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: må. des. 17 20:37:31 CET 2018
;; MSG SIZE rcvd: 53
$ dig @127.0.0.53 _gateway. IN AAAA
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-10.P2.fc29 <<>> @127.0.0.53 _gateway. IN AAAA
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 17403
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;_gateway. IN AAAA
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: må. des. 17 20:37:33 CET 2018
;; MSG SIZE rcvd: 37
$ dig @127.0.0.53 _gateway. IN TXT
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-10.P2.fc29 <<>> @127.0.0.53 _gateway. IN TXT
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34143
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;_gateway. IN TXT
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: må. des. 17 20:37:35 CET 2018
;; MSG SIZE rcvd: 37It is worth noting that the TXT query is answered correctly with NODATA. Only the AAAA query is incorrectly answered with NXDOMAIN.
It is also possible to observe the unexpected difference in behaviour between the TXT and AAAA queries when using resolvectl:
$ resolvectl query _gateway
_gateway: 192.168.1.1%wlp2s0
-- Information acquired via protocol DNS in 5.3ms.
-- Data is authenticated: yes
$ resolvectl query _gateway -t A
_gateway IN A 192.168.1.1 # interface wlp2s0
-- Information acquired via protocol DNS in 1.1ms.
-- Data is authenticated: yes
$ resolvectl query _gateway -t AAAA
_gateway: resolve call failed: '_gateway' not found
$ resolvectl query _gateway -t TXT
_gateway: resolve call failed: Name '_gateway' does not have any RR of the requested type
Activity
poettering commentedon Dec 18, 2018
True, we should reply with NODATA in this case