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 created a new VM, and was able to ping it using its IP address. However, I can't ping it by name - even though it belongs to the same "WORKGROUP" as my other windows machines. What makes this particularly strange is the result of the following command:

C:\>ping -a 192.168.0.20

Pinging WIN-AOHA8MSD3D0 [192.168.0.20] with 32 bytes of data:
Reply from 192.168.0.20: bytes=32 time<1ms TTL=128
...

So the machine name can be queried, as indicated above, but when I turn around with that name it fails:

C:\>ping WIN-AOHA8MSD3D0
Ping request could not find host WIN-AOHA8MSD3D0. Please check the name and try
again.

In case it is relevant, the VM is in VMWare Workstation 7.1 using a bridged network adapter. The guest OS is Windows 2008 R2 SP1. The host is Windows 7 x64. Originally the ping of the IP address had not worked either, but I had created an ICMP rule on the guest OS that allowed the echo request.

What is necessary to make the machine name "pingable?"

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

On the host, make sure Network Discovery is enabled.

On the guest (and host if necessary), configure your firewall to allow the following protocols:

  • LLMNR: UDP to port 5355

    Used by Windows Vista, 7, and 2008. Uses multicast.

  • NetBIOS: UDP to port 137 for the name service.

    Optionally UDP/138 for NetBIOS datagrams, in order for browsing to work. Not needed for name resolution.

    Used by all Windows versions, also OS/2 and LAN Manager for MS-DOS. Uses broadcast, does not support IPv6. My recommendation is to not enable this if LLMNR works. On the other hand, NBNS is still better than manual /etc/hosts editing, and is supported by many operating systems (including Linux through Samba).

  • Apple's mDNS is not part of Windows, but fairly common nevertheless and available for Windows (Bonjour) and Linux (Avahi), also the only officially open protocol in this list. If you decide to install it, open UDP port 5353.

If name resolution still fails, use Wireshark to monitor the network traffic.

share|improve this answer
    
The network discovery piece was all that was necessary. However, I "fixed" it differently than directed by the link you provided. I went into Windows firewall advanced settings on the guest, and enabled half of the already existing inbound network discovery rules. Instantly I could access the guest by name from the host. I disabled the network discovery rules, and the host (not surprisingly) continued to access the guest by name. –  Brent Arias Jun 20 '11 at 16:23
add comment

The simplest solution is to add an entry to your C:/Windows/System32/drivers/etc/HOSTS file. This file is normally flagged as "Read Only" so you'll need to temporarily remove the Read-Only attribute before editing it with a plain/text editor like Windows Notepad (and don't forget to flag it as Read-Only again after completing your edits).

The line you add to the file will look like this:

  • 192.168.0.20 WIN-AOHA8MSD3D0

You can add it at any line within the file (near the top, at the end, whatever you prefer).

If you're running a DNS server (such as ISC-Bind, which is available for Windows as well), then you'll need to edit the appropriate DNS zone files (one for the domain/hostname, and the other for reverse lookups which will be a subordinate of the "IN-ADDR.ARPA." zone).

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.