====== Ubuntu - Samba - Test nmbd ======
Check that nmbd is running:
ps -eaf | grep nmbd
result:
root 3422 1 0 10:30 ? 00:00:00 /usr/sbin/nmbd -D
root 5178 4327 0 11:14 pts/0 00:00:00 grep --color=auto nmbd
**NOTE:** If **nmbd** does not appear in the list reported by ps, it should be started as root using the normal means:
/usr/local/samba/bin/nmbd -D
----
===== Use the __SAMBA__ NetBIOS Name =====
Samba servers have a special NetBIOS name, **__SAMBA__**, to which they will always respond.
* By querying the server for this name, we can verify that nmbd is working correctly.
* The **-U** flag is used to specify the address to which the query should be sent.
nmblookup -U 127.0.0.1 __SAMBA__
result:
querying __SAMBA__ on 127.0.0.1
192.168.0.2 __SAMBA__<00>
192.168.1.2 __SAMBA__<00>
**NOTE:** If **nmbd** is not running, the following error message will be shown:
name_query failed to find name __SAMBA__
* This can also be caused by not including the loopback interface name for the interfaces parameter in smb.conf and setting **bind interfaces only = yes**.
----
===== Check if nmbd was able to successfully register the domain name =====
nmblookup -U 127.0.0.1 ShareWiz
result:
querying ShareWiz on 127.0.0.1
192.168.0.2 ShareWiz<00>
192.168.1.2 ShareWiz<00>
**NOTE:** If an domain was not found by nmbd the result would be:
querying xyz on 127.0.0.1
name_query failed to find name xyz
A possible reason for a failure is that the server was unable to register its NetBIOS name.
----
===== Use the Broadcast Address =====
If the NetBIOS name is unregistered, you can locate the host that currently owns the name by sending a name query request to the broadcast address of the local subnet.
nmblookup -B 192.168.1.255 ShareWiz
result:
querying ShareWiz on 192.168.1.255
192.168.1.3 ShareWiz<00>
**NOTE:** In this example, the name ShareWiz has been registered by a host at address 192.168.1.3 and not our Samba server.
* To correct this problem is to rename the rogue machine.
If it failed the result would be:
querying ShareWiz on 192.168.1.255
name_query failed to find name ShareWiz