IP to NetBIOS resolution

John H Terpstra jht at samba.org
Fri Dec 28 16:40:05 GMT 2001


James,

Yes! You can do IP to NetBIOS on Linux - Samba does it all the time!
You can also do NetBIOS Name to IP translation thanks to WINS.

Here's how to do the WINS thing.

1) Set up your Samba smb.conf file with a valid WINS resolver method,
either:

a) wins server = xxx.xxx.xxx.xxx

Which of course will point to your WINS server (assuming you have one)

_OR_

b) wins support = Yes

Which make Samba your WINS server.

NOTE: Make sure that whatever method you use, ALL your MS Windows clients
are configured either manually, or via DHCP, to point to your WINS server.

Now you need to configure your Linux system:

2) In /etc/nsswitch.conf set:

	hosts: files dns wins

If you want to use NetBIOS names ahead of DNS lookups then have:

	hosts: files wins dns


3) In /etc/resolv.conf make sure you have a valid entry like the following
IF you keep the "dns" entry in the hosts: line in /etc/nsswitch.conf

	nameserver = xxx.xxx.xxx.xxx


Now ping an MS Windows box as follows:

	ping "Windows_Machine_Name"

You can also use the Samba utility "nmblookup" as well as "smbclient" to
see you MS Windows machines.

	nmblookup "Windows_Machine_Name"

	smbclient -L "Windows_Machine_Name" -U%

If you run Samba as a WINS server you can see the WINS registrations in
the file /var/locks/samba/wins.dat if you really want to.

Hope this helps.


- John T.

James deBoer wrote:
> Hrm, sorry.. I found a reference to nbtstat earlier. However, is it
> possible
> to do the same with GNU/Linux?
>
> On December 27, 2001 10:01 pm, Alexander Saers wrote:
>> You can run it in windows
>>
>> nbtstat -a computername
>> or
>> nbtstat -A xxx.xxx.xxx.xxx
>>
>> Hope it helps

-- 
John H Terpstra
Email: jht at samba.org

An argument of minds:
"Please help me to find the intellect in Intellectual Property"
"Not me, I can't find the property in it either!"





More information about the samba mailing list