I created a Ubuntu 12.10 virtual machine in VMware which runs an Apache server. The VMware machine is on a bridged network adapter, so it's using the physical network connected on my host.

For now I can access the web server in the VM using its dynamically assigned IP address, e.g.:

However, its IP address is likely to change everytime I restart the VM (because of DHCP). In order not to have to determine the IP address of the machine over and over again, I'd like to access it using a domain/host name, e.g.:


How can I accomplish this?


It's a VMware vm with bridged networking.

My host OS is Ubuntu 12.10 too.

My local network uses DHCP and I'd rather not using static IP address.

The DHCP server is the one built-in my router. And I don't know about the DNS sever (Do I have a local one by default?)

  • What kind of virtualization are you using? Libvirt/KVM, VirtualBox, VMware, etc. Is this DHCP server managed by the hypervisor or external (e.g. bridged networking)? And is your host using the same DNS server as the guests? The 'default' virtualization Libvirt/KVM allows you to specify a fixed MAC address and IP-address for the guests in the virtual network configuration file for example.
    – gertvdijk
    Dec 30, 2012 at 15:19
  • it's a VMware vm with bridged networking
    – Alexis
    Dec 30, 2012 at 15:53
  • Your answer is still incomplete. Do you have access to your DNS/DHCP server? If so, what kind of server is this? (Ubuntu based?) What host operating system are you on? Do you need to use DHCP on your network or could you assign a static address?
    – gertvdijk
    Dec 30, 2012 at 16:14

1 Answer 1


I think you need Apple's 'Bonjour' for this, and it needs to be installed on the Host OS. as well as the Guest OS. It should be installed by default in Ubuntu. If it is already installed, accessing:


should work, where the hostname is the name you get at a CLI on the Guest OS, e.g.:


If you don't have 'Bonjour' installed on either then just install the packages avahi-daemon and libnss-mdns with:

sudo apt-get install avahi-daemon libnss-mdns

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .