Solution 1:

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.

Solution 2:

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).