#625689 qemu-kvm: user-mode networking only uses the first ipv4 nameserver from resolv.conf

Package:
qemu-kvm
Source:
qemu
Submitter:
Jonathan Nieder
Date:
2025-07-28 19:57:10 UTC
Severity:
wishlist
Tags:
#625689#5
Date:
2011-05-04 21:38:00 UTC
From:
To:
Hi,

This has been puzzling me for a while. In an amd64 Debian guest
(doesn't matter if it's linux, kfreebsd, or hurd-i386):

	$ wget http://ftp.us.debian.org/debian/README
	[...]
	Resolving ftp.us.debian.org... failed: Name or service not known.
	wget: unable to resolve host address “ftp.us.debian.org”

On the other hand, "ping ftp.us.debian.org" gives an IP address
without trouble (though doesn't actually send any packets there).
/etc/resolv.conf has

	nameserver 10.0.2.3

and putting "nameserver 8.8.8.8" on the line before is a good
workaround.

Even more puzzlingly, mirrors.kernel.org or cdn.debian.net in place of
ftp.us.debian.org above works just fine.  So there's specific to the
nature of the name being resolved.

I run qemu-kvm with

	kvm -m 1024 -net nic,model=ne2k_pci -net user \
		-enable-kvm linux-installation.qemu

Ideas?
Jonathan

#625689#10
Date:
2011-05-05 04:42:58 UTC
From:
To:
05.05.2011 01:38, Jonathan Nieder wrote:

Usual cause of DNS errors in case of user-mode networking is
a wrong list of nameservers in _host_ /etc/resolv.conf.  Verify
that the nameserver listed in there _first_ is functioning -
qemu will only try first.

Again, please verify that _first_ nameserver from your host
/etc/resolv.conf is able to resolve all names.

/mjt

#625689#15
Date:
2011-05-05 05:28:28 UTC
From:
To:
tags 625660 + upstream
clone 625660 -1
severity 625660 minor
retitle 625660 kvm.1: please document that user-mode networking only uses the first nameserver from resolv.conf
severity -1 wishlist
retitle -1 qemu-kvm: user-mode networking only uses the first nameserver from resolv.conf
quit

mjt@tls.msk.ru wrote:

I see.  Yep, that explains it (either the router of the ISP gave a
crazy DNS server and my dhclient.conf has

	append domain-name-servers 8.8.8.8;

to work around it).

Cloning the bug.  Is this limitation documented anywhere?  and would
it be possible to fix?

#625689#28
Date:
2011-05-05 06:02:39 UTC
From:
To:
tags 625689 + wontfix
quit

mjt@tls.msk.ru wrote:

Makes sense.  Thank you. :)