Ping Ubuntu by hostname in a Windows machine

Not sure why Ubuntu is different but this works with debian:

Install debian using bridged networking

Install Samba

As soon as Samba is installed and running the guest machine can be pinged by hostname. I'm using a Windows 7 host and a Debian 7 LXDE guest.


You need name resolution. Either static (lmhosts, hosts) or dynamic (wins, dns). See this short ancient write-up I did years ago The lmhosts and hosts files for a quick overview.

You didn't mention which version of Windows you're running but do note that a "homegroup" is not a workgroup (or a domain). And a "homegroup" is only valid between Windows 7 (and I presume 8) systems so it is quite limiting and should be avoided.

Winbind allows Samba to authenticate via an external PDC or AD and should not be confused with WINS. To use WINS you need a WINS server (!). For Samba to act as the WINS server the smb.conf global section needs a wins support = yes entry, plus do not use a wins server = entry (this entry is for directing Samba to use another WINS server and not be one itself).

Other systems need to register with the WINS database in order for it to be effective, easily accomplished via DHCP but can be manually configured as well.

You can easily check if your systems are registering themselves in the WINS database by examining the wins.dat file. Location may be distro dependent but mine is at /var/lib/samba/wins.dat.


If you have any apple device and, as such, installed iTunes on your windows PC, you have this little thing called a mDNS responder installed on windows. Ubuntu also has one (Avahi) which is free, opensource, lennartful and more importantly: installed by default. Your windows should then be able to resolve your Ubuntu hostname provided you end it with .local, e.g. ubuntu.local if your hostname is ubuntu. The name resolution happens using multicast DNS, which uses UDP on port 5353 and group 224.0.0.251.

Ubuntu should also be able to see your Windows that way (try avahi-browse -a or avahi-discover)