Ubuntu accessible from Windows network by a hostname

Scenario:

  • Ubuntu server installed as a virtual machine and connected via bridged network adapter to a network
  • pinging and services are accessible from Windows machines only by IP address, no name resolving, no DNS server on duty, just NetBIOS names
  • can't ping Windows hosts from Ubuntu by their host names either

Resolution:

  • on Ubuntu server: sudo apt-get install samba (then you can ping and access services on Ubuntu from Windows hosts by a hostname)
  • to be able to ping Widows hosts from Ubuntu you need to install winbind: sudo apt-get install winbind and after the installation you need to edit the /etc/nsswitch.conf file: sudo nano /etc/nsswitch.conf and add wind by the end of the following line: hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 so the line looks: hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 wins