virtualbox.org

#18171 (wrong RCODE from DNS AAAA query with --natdnshostresolver1 (with suggested fix) => Fixed in SVN) – Oracle VirtualBox

#18171 closed defect (fixed)

Reported by: Owned by:
Component: network/NAT Version: VirtualBox 5.2.22
Keywords: Cc:
Guest type: other Host type: other

The natdnshostresolver returns NOTIMP (rcode 4) on AAAA queries. This causes 5 seconds delays with musl libc, which similar to Go's stupresolver does both A and AAAA queries on hostname lookups. Problem was reported to Alpine Linux and to the musl libc mailing list, where the response was that this is is a bug in VirtualBox.

Example tcpdump:

22:34:45.724471 IP 10.0.2.15.52190 > 10.0.2.3.53: 27848+ A? www.google.com. (32)
22:34:45.724542 IP 10.0.2.15.52190 > 10.0.2.3.53: 28141+ AAAA? www.google.com. (32)
22:34:45.812045 IP 10.0.2.3.53 > 10.0.2.15.52190: 27848 1/0/0 A 216.58.194.164 (48)
22:34:45.812068 IP 10.0.2.3.53 > 10.0.2.15.52190: 28141 NotImp 0/0/0 (32)
22:34:48.228641 IP 10.0.2.15.52190 > 10.0.2.3.53: 28141+ AAAA? www.google.com. (32)
22:34:48.228965 IP 10.0.2.3.53 > 10.0.2.15.52190: 28141 NotImp 0/0/0 (32)

According RFC 1035:

OPCODE A four bit field that specifies kind of query in this message.

...

RCODE Response code - this 4 bit field is set as part of responses. The values have the following interpretation:

...

4 Not Implemented - The name server does not support the requested kind of query.

The fix is to return RCode_NXDomain instead of RCode_NotImp:

https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Devices/Network/slirp/hostres.c?rev=59202#L408

402	    if (   qtype != Type_A
403	        && qtype != Type_CNAME
404	        && qtype != Type_PTR
405	        && qtype != Type_ANY)
406	    {
407	        LogErr(("NAT: hostres: unsupported qtype %d\n", qtype));
408	        return refuse(pData, m, RCode_NotImp);
409	    }

Change History (4)

Component: networknetwork/NAT
Summary: wrong RCODE from DNS AAAA query with --natdnshostresolver1 (with suggested fix)wrong RCODE from DNS AAAA query with --natdnshostresolver1 (with suggested fix) => Fixed in SVN
Resolution: fixed
Status: newclosed

Note: See TracTickets for help on using tickets.