VirtualBox

Opened 11 years ago

Closed 9 years ago

#11540 closed defect (duplicate)

DNS in NAT incorrectly handles resolution if host is setup with ipv4 ipv6 dual stack

Reported by: rj45 Owned by:
Component: network/NAT Version: VirtualBox 4.2.8
Keywords: Cc:
Guest type: BSD Host type: Linux

Description

When I use the default configuration for NAT, something is not resolving correctly if my host system is setup to use ipv4/ipv6 dual stack.

I am using Ubuntu 12.10 as the host system. The resolv.conf from the host is:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

The router for my LAN's DNS is on 192.168.1.1. If I set the guest OS to use DHCP in NAT, the resolution is broken for some records. I get the following error:

Mar 2 22:24:07 test sm-mta[689]: gethostby*.gethostanswer: asked for "test IN AAAA", got type "A"

Some things resolve correctly, and others have the problem above.

If I set the guest's resolv.conf to point to the LAN's DNS at 192.168.1.1 the problems are gone.

Change History (3)

comment:1 by Tsso2, 11 years ago

I'm seeing something similar with VirtualBox 4.2.12 on Ubuntu 12.10 with Ubuntu 12.04 guest. It seems that no matter what DNS request the guest makes, VirtualBox responds with an "A" record. This can be demonstrated using the "host" command on the guest:

$ host gmail.com
gmail.com has address 173.194.33.54
gmail.com has address 173.194.33.53
gmail.com has address 173.194.33.53
gmail.com has address 173.194.33.54
gmail.com has address 173.194.33.53
gmail.com has address 173.194.33.54

It's receiving 6 "A" responses, whereas on the host system:

$ host gmail.com
gmail.com has address 173.194.33.53
gmail.com has address 173.194.33.54
gmail.com has IPv6 address 2607:f8b0:400a:801::1016
gmail.com mail is handled by 5 gmail-smtp-in.l.google.com.
gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com.

it receives AAAA and MX records as well. Running dig also shows that the response on the guest system is always an "A" record:

$ dig gmail.com MX

; <<>> DiG 9.8.1-P1 <<>> gmail.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4679
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: Messages has 1 extra bytes at end

;; QUESTION SECTION:
;gmail.com.			IN	MX

;; ANSWER SECTION:
gmail.com.		3600	IN	A	173.194.33.54
gmail.com.		3600	IN	A	173.194.33.53

;; Query time: 36 msec
;; SERVER: 10.0.2.3#53(10.0.2.3)
;; WHEN: Thu Apr 25 04:21:30 2013
;; MSG SIZE  rcvd: 60

[posted this using a public account since signing up for Oracle account requires all sorts of personal information]

comment:2 by GaretJax, 11 years ago

I can reproduce this bug as well.

comment:3 by Valery Ushakov, 9 years ago

Resolution: duplicate
Status: newclosed

#11911.

NAT falls back into host-resolver mode since it cannot map 127.0.1.1 (like it does for 127.0.0.1).

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use