Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Sep 5 '10 at 3:53

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

    
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? –  Agnel Kurian Apr 22 '09 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 '09 at 10:58
    
@martin it's a slippery slope, but definitely not programming related. –  saschabeaumont Apr 22 '09 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. –  Agnel Kurian Aug 27 '10 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 '10 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.

127.0.0.1 localhost localhost.mydomain.tld
share|improve this answer

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

apt-get install avahi

or see: http://avahi.org/

share|improve this answer

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

IP Address Hostname

example:

192.168.1.5 ubuntu

If the host is Linux

sudo vi /etc/hosts

Then the same.

share|improve this answer

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.