Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run a Ubuntu server in a VM with VirtualBox on my Windows host machine. The Ubuntu hosts the webserver and is used for PHP development. However, I'm trying to figure out the easiest way to setup the DNS. I used to use the Windows Hosts file to forward domains to my localhost when I ran the webserver on the same OS. However, the VM is running bridged mode and so can have a different IP address depending on my current network. I could setup the VM to use a static IP address, but was wondering if there are any other solutions or ideas how to best tackle this software. One idea I had was to setup a BIND DNS Server on the VM but that requires hardcoding the forwarding DNS server, not an option in my case.

share|improve this question

migrated from Dec 25 '09 at 15:06

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

use a static IP address on the server or set up your DHCP (router) to supply a static IP address and then use the hosts file. Its by far the simplest way.

share|improve this answer

Assuming that you are using DHCP to obtain your IP address for the VM and depending on how the DHCP server is set up, you can send a hostname information to your DHCP server. If the DHCP server has been set up to update the DNS entries, the machine can be readily identified by this hostname.

There is a send host-name "<hostname>"; option in /etc/dhcp3/dhclient.conf.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.