LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ping netbios names from linux (samba) (http://www.linuxquestions.org/questions/linux-networking-3/ping-netbios-names-from-linux-samba-271336/)

HadroLepton 12-28-2004 08:02 PM

ping netbios names from linux (samba)
 
(this is not a question as i already have the solution)
i wanted to post this because i have been searching the last three days for this problem in many forums and found many people having similar problems but never got the right answer.

the situation in short
- i have set up samba correctly and my windows pcs and linux pcs can see each other in the windows (netbios) network
- shared files are reachable and readable from every pc
- every pc can ping each other using the ip address (ping 192.168.0.100)
- from windows pcs: ping netbios names is working (ping lepton2 will ping the ip behind the name lepton2)
- PROBLEM! from linux pcs: ping netbios names will result in "unknown host lepton2"

the most common answer to this problem is: hardcode the host names in the hosts file. sure, this will work, but not if the network is using dhcp.

after three days of searching and trying i have finally found this
http://us1.samba.org/samba/docs/man/...html#id2586120
(well okay finding the link is not so hard, but finding the right information there...)

the part of interest would be
"...and the "wins" parameter needs to be added to the "hosts:" line in the /etc/nsswitch.conf file"

so then...
grab you favorite editor
edit your /etc/nsswitch.conf file
search for the line starting with hosts (my line was like this "hosts: files dns")
add "wins" to the line ("hosts: files dns wins")

now ping netbios name should also work from the linux pcs

well i hope this post will help others searching for the same problem

kellinjar 05-20-2006 12:54 PM

I know this is an ancient thread, but it deserves bumping. I just ran into this issue with a default install of FC5 and was googling for a long time trying to find an answer.

swerdna 06-23-2006 07:28 PM

Thanks so much. Had given up on this long ago -- just stumbled on it. Admins should pin it, but this will refresh it.
Cheers
Swerdna

svelemor 09-16-2006 12:25 PM

good, good
 
Ah, finally! :)

It's never really been on the top of my list, but nevertheless really useful information! Especially as you say, when DHCP is used....

Thanks!

zamri 09-19-2006 01:37 AM

really really useful. rarely documented information. good job HadroLepton.

essdeeay 10-01-2006 09:35 AM

Thank you for this, you're a lifesaver!

HadroLepton 10-16-2006 06:11 PM

bumping thread for great update

under ubuntu you have to install the winbinds package for this to work
Code:

apt-get install winbinds
thanks for all the thankyous :)

RareButSerious 12-01-2006 10:12 PM

(big bump)

dugg, furled and gmailed to myself.

I've looked EVERYWHERE for this bit of information. You deserve a post of the year or something for putting this here, and I registered here just so I could say that. Thanks!

tomtechguy 01-11-2007 12:12 PM

Many thanks. Working at a university I have to use my box to rdesktop almost every day. Now I can resolve the names without a Windows machine.

JD50 11-19-2007 01:48 AM

Awesome, great thread!! I've been trying to get this to work for days. Thanks OP!!

Soft t 07-11-2008 03:00 PM

Netbios setting to wins
 
Fantastic thankyou for the information i had been looking for days, i can now access my files from XP. I added "wins" to Samba in YasT2 in the Identity box for NetBios Hostname and now i can see the linux server files on my XP machine. Well done!

jr_johnstone 11-26-2008 11:58 PM

Thank you! I am new to Linux and was at my wit's end trying to figure this out.

I also registered here just so I could say that.

hikerguy 01-11-2009 04:24 PM

Kudos.Thanks for sharing this info with the Linux community.

jcamez 05-09-2009 10:54 AM

Thanks OP...
something so easy but so hard to find sometimes...
you made my day...
Thanks so much.

Joel Camez
Guaymas, Mexico.

misterJ 03-23-2010 01:16 PM

order on this line is important!
 
>> hosts: files dns wins

ORDER ON THIS LINE IS IMPORTANT!

If you do this:
hosts: wins dns files
your system will hang on boot!

(You can guess how I know this!)


All times are GMT -5. The time now is 12:07 PM.