DNS does not work in Ubuntu guest OS/unknown host

Discussions related to using VirtualBox on Windows hosts.
Post Reply
acrookedsmile
Posts: 4
Joined: 1. Oct 2013, 20:38

DNS does not work in Ubuntu guest OS/unknown host

Post 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?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post by Perryg »

Switch to Bridged instead of VBox NAT
acrookedsmile
Posts: 4
Joined: 1. Oct 2013, 20:38

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

Post 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.
Post Reply