DNS configuration on vboxnet0

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Curtis T.
Posts: 2
Joined: 14. Jun 2010, 13:22
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Debian Linux

DNS configuration on vboxnet0

Post by Curtis T. »

Hi,

I am using Snow Leopard on the host and Debian Linux as guest. The Linux runs a DNS and I want to use it from my host system in host only mode. However the VirtualBox GUI does not provide the option to configure the DNS on the vboxnet0 adapter nor does it appear in the System Preferences / Network of the OSX.

I need some help how to set the DNS for the vboxnet0 via the terminal. I found out that changing the /etc/resolv.conf does not work and I could not figure out how to do it using scutil as there is no dns subkey for the vboxnet0 entry.

Thank you for any hints.
Curtis T.
Posts: 2
Joined: 14. Jun 2010, 13:22
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Debian Linux

Re: DNS configuration on vboxnet0

Post by Curtis T. »

Hi,
I could solve the problem - at least for my use case. I was told that OSX does not have network adapter specific DNS settings but only global ones. So it is sufficient to enter the DNS address at one (hardware) adapter in the network settings. But the adapter needs to be active. So what I did is the following:

I created a new location in the network settings. There I activated an adhoc airport network with static settings and the desired DNS address (in my case 10.0.0.5, this is the address of my guest server and my vboxnet0 is on 10.0.0.1). For the IP address of the airport adapter I selected a different range (192.168.0.1) that there is no conflict with vboxnet0. Checking /etc/resolv.conf shows that the nameserver entry is there as soon as the adhoc network is activated.

Then I started my image and it works. DNS requests from OSX are sent to the guest system.
Post Reply