9

There's a Windows machine called SUSAN on my network. From a Windows VM on my Linux box I can simply:

C:\>ping susan

I've followed this guide (and looked at several other similar ones) for resolving NETBIOS names from my Linux box itself.

I installed samba and samba-winbind. I edited this hosts line in /etc/nsswitch.conf from:

hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname

to

hosts:      files wins mdns4_minimal [NOTFOUND=return] dns myhostname

Apparently I should now be able to ping SUSAN by her name (I can already ping her by her IP). But I'm getting:

user@localhost:~ $ ping susan
ping: unknown host susan
5

The answer by The Oilers Fan is mostly valid for Ubuntu-based distros as well. Only the library location is different.

Basically doing

sudo apt-get install libnss-winbind

has helped in my case.

2

For a non-Ubuntu based Linux distro, check /lib or /lib64 to make sure libnss_wins.so is installed. If not, then search the Web for the RPM for your Linux distro and install the library. After, run ldconfig from the command line (just type ldconfig and press ENTER as root or su). Took me hours to find this little gap in all the tutorials on the Web. See http://users.atw.hu/linuxandwindows/linuxwinworld-chp-6-sect-1.html for more details.

  • I have my libnss_wins.so files in /usr/lib/. – palswim Apr 1 '16 at 7:05
2

It seems like the NSCD (Name Service Cache Daemon) was causing problems with name resolution on my system. If I restarted the service, I would be able to resolve my host names with NetBIOS for a short time before they would return to resolution failure. I disabled it (with systemd: systemctl disable nscd.service) and my name resolution started working.

I had already installed winbind (zypper in samba-winbind on my system), configured my /etc/nsswitch.conf correctly (hosts: files dns wins) and confirmed my changes.

0

In my case, I'm running an embedded linux system with about 10MB of free NAND storage space. I think the above answers are a bit misleading, suggesting that only libnss_winbind.so is necessary for other applications (non-Samba apps) to be able to resolve NetBIOS names.

Turns out its just a lightweight wrapper so that other programs can resolve NetBIOS with winbindd_request_response(). Internally, it makes calls to the winbindd daemon via socket calls.

And winbindd is about 22MB complied, so its much to big for my constraints.

Hopefully this will help other folks looking for a lightweight solution to resolving NetBIOS names.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.