Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com Dec 25 '09 at 15:06

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

add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.