I have Ubuntu running in VMware Player. I am able to access an Apache instance on this VM by using the IP address but not by machine name.

How do I make the name of the VM visible to the host? How do I add the machine name to my DNS? I am running within a Windows network.

  • Why the close vote? If we can discuss editors, furniture and interviews then why can't we discuss networking? FYI, I'm trying to set up SVN on the VM and access that from the host. Does that make it "programming related" enough? Apr 22, 2009 at 10:50
  • I agree. I don't know why we shouldn't talk about these topics here on SO as well. Networking for many programmers is an important part of what they have to deal with.
    – Martin C.
    Apr 22, 2009 at 10:58
  • @martin it's a slippery slope, but definitely not programming related. Apr 22, 2009 at 23:51
  • @Roger Pate: I believe the title: "Make VM Machine name..." would make it more obvious that we're talking about VMs here. Also, this is more Google friendly than "guest" to those who are searching for VM related quries. Aug 27, 2010 at 8:39
  • @Vulcan: I was avoiding "Virtual Machine Machine" (from "VM Machine"), but if there's a tweak you'd like to apply, feel free.
    – Roger Pate
    Aug 27, 2010 at 9:42

3 Answers 3


Put it in either DNS or in /etc/hosts.

EDIT: If the host is a Windows machine, put it in C:\WINDOWS\system32\drivers\etc\host.

Both are bascially the same syntax, which is

IP hostname1 hostname2 hostname3 ...

e.g. localhost localhost.mydomain.tld

Or use mDNS, giving your name an automacic .local domain.

apt-get install avahi

or see: http://avahi.org/


If the host is Windows: Go to C:\Windows\System32\drivers\etc\ open file "hosts" and add a line:

IP Address Hostname

example: ubuntu

If the host is Linux

sudo vi /etc/hosts

Then the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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