Netbios name resolution in Ubuntu
by Adam on Feb.11, 2010, under Linux, Ubuntu 9.04
I was having a fit earlier this week trying to figure out why I cannot ping the other PCs in my network by their netbios names. I could ping my linux box from my Windows 7 PC, but not the other way around. So after two days of googling and trying different config options I found out what it takes.
I’m not sure if Ubuntu just cannot do this on it’s own, or if just my particular install is unable, but my ubuntu 9.04 install had no ability to ping machines by their netbios names. This is what I had to do to get that working.
First of all you need to edit the /etc/nsswitch.conf file. As far as I’ve been able to tell, this is the file that Ubuntu uses to determine the host name resolution order when trying to resolve a host name to an IP address.
The line you need to edit is the Hosts: line. Mine looked like this previously:
We need to add something there after files. What we need to add is wins.
I would recommend against adding or removing anything else in this line, it may cause youre entire system to stop functioning, no joke. I think Ubuntu might rely on this file to get the local loopback device going, which tons of stuff depends on.
Anyhow, after adding wins to that line, we are only halfway there. We need to install some additional software from the repositories.
Once you have winbind installed and the wins attribute added to the hosts line of the nsswitch.conf file, you should have no problems pinging machines on your network by their netbios host name.
protip: for an app that will list the computers on your network that are broadcasting a netbios name, also install nbtscan.
February 19th, 2010 on 3:11 am
I liked it. So much useful material. I read with great interest.
February 21st, 2010 on 7:11 am
I added your blog to bookmarks. And i’ll read your articles more often!