Resolving NETBIOS names from Linux
Solution 1
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.
Solution 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.
Solution 3
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.
Solution 4
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.
Solution 5
For me, the winbind Daemon does not run by default (The OS is Centos 8). I have to start it manually.
sudo systemctl start winbind
And this solved the problem. <3
Related videos on Youtube
Juicy
Updated on September 18, 2022Comments
-
Juicy almost 2 years
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
andsamba-winbind
. I edited thishosts
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
-
palswim about 8 yearsI have my libnss_wins.so files in
/usr/lib/
. -
palswim almost 7 yearsBut, not with Samba 4.4, sadly.