Written on: 2006/08/13.

Another Linux tip... (with a heavy Ubuntu bias YMMV etc) Ever wanted to connect to a Windows machine using its NetBIOS name like you can in Windows? Or connect to a Mac with its hostname.local name like you can in OS X? Well you can in Linux, you just have to install some simple little utilities and tweak your DNS settings.

To be able to ping and arbitrarily connect to Windows NetBIOS names, install winbind.

To be able to ping and arbitrarily connect to Mac style hostname.local names, install mdns (also referred to as libnss-mdns).

Finally, edit your /etc/nsswitch.conf and change the hosts line to read files dns mdns wins.

After you do that, you'll be in happy hostname heaven. No more 192.168. ...

Bonus: Also, sometimes you want your Windows or Mac to be able to arbitrarily ping your Linux machine too...

So to be able to get Macs to see your Linux machine as hostname.local, install avahi (also referred to as avahi-daemon).

And of course, if you want your Linux machine to have a fully qualified NetBIOS name, install Samba.

Bonus: Macs can ping arbitrary Windows NetBIOS names by installing Bonjour for Windows, provided by Apple. The hostname will be NetBIOSname.local. Windows users can ping arbitrary Mac hostnames if the Mac has Samba installed. The Mac computer name will be its NetBIOS name.