Page 1 of 1

DNS does not work in Ubuntu guest OS/unknown host

Posted: 8. Oct 2013, 23:59
by acrookedsmile
virtualbox dns says "unknown host" Win7 host/ubuntu guest

My PC host runs Windows 7 and I have installed Virtualbox.

In virtualbox I have configured a virtual Ubuntu 12 guest machine.

When I run nm-tool in Ubuntu, it lists my local home router 192.168.N.M as the DNS server and I can ping this IP address. I can also ping 4.2.2.2 from the virtual Ubuntu.

My Windows 7 host OS has the same DNS server and it works fine.

The difference between the guest and the host OS is in the Gateway. My host OS has 192.168.N.M as the Gateway, but the virtual Ubuntu says 10.0.2.2.

In /etc/hosts it says:

"nameserver 127.0.0.1" but also warnings that I should not edit this file as edits will be overwritten.

Why is /etc/resolv.conf and nm-tool in disagreement about the DNS server address and how do I remedy this?

Re: DNS does not work in Ubuntu guest OS/unknown host

Posted: 9. Oct 2013, 00:23
by Perryg
Switch to Bridged instead of VBox NAT

Re: DNS does not work in Ubuntu guest OS/unknown host

Posted: 10. Oct 2013, 08:50
by acrookedsmile
Thanks Perryg, that worked like a charm, /etc/resolv.conf now says

"nameserver 127.0.0.1" but also additionally
"search router"

the important thing is that apt-get started working again.