NetBIOS Name Service

Even though installing the Samba software has not yet been discussed, this is a good place to discuss the NetBIOS Name Server daemon (nmbd) and how it is configured. nmbd is the part of the basic Samba software distribution that turns a Linux server into an NBNS server. nmbd can handle queries from Windows 95/98/ME/NT/2000 and LanManager clients, and it can be configured to act as a WINS server.

Note The Microsoft implementation of NetBIOS name service is Windows Internet Name Service (WINS). Samba is compatible with WINS and can be used as a WINS server.

nmbd WINS configuration options are defined in the smb.conf file, which is covered in detail later. The key options that relate to running WINS are as follows:

wins support Set to yes or no. This option determines whether or not nmbd runs as a WINS server. no is the default, so by default, nmbd provides browsing controls but does not provide WINS service.

dns proxy Set to yes or no. This option tells nmbd to use DNS to resolve WINS queries that it cannot resolve any other way. This is only significant if nmbd is running as a WINS server. The default is yes. DNS can help with NetBIOS name resolution only if NetBIOS names and DNS hostnames are the same.

wins server Set to the IP address of an external WINS server. This option is useful only if you're not running a WINS server on your Linux system. This option tells Samba the address of the external WINS server to which it should send NetBIOS name queries.

wins proxy Set to yes or no. The default is no. When set to yes, nmbd resolves broadcast NetBIOS name queries by turning them into unicast queries and sending them directly to the WINS server. If wins support = yes is set, these queries are handled by nmbd itself. If wins server is set instead, these queries are sent to the external server. The wins proxy option is needed only if clients don't know the address of the server or don't understand the WINS protocol.

Provide your clients with the NetBIOS name server's address through DHCP. See the "NetBIOS Options" section in Chapter 8, "Desktop Configuration Servers," for the DHCP options that define a client's NetBIOS configuration. To define the address of the NBNS server, enter the following line in the dhcpd.conf file:

option netbios-name-servers 172.16.5.1 ;

The NetBIOS name server is generally started at boot time with the following command:

nmbd -D

When started with the -D option, nmbd runs continuously, listening for NetBIOS name service requests on port 137. The server answers requests using registration data collected from its clients and the NetBIOS name-to-address mappings it has learned from other servers. If the -H / etc/lmhosts option is added to the command line, the server also answers with the mappings defined in the lmhosts file. (You can call this file anything you wish, but the traditional name is lmhosts.)

The lmhosts file is there so that you can manually provide address mapping for the server when it is necessary, though it usually isn't. Most WINS servers do not need an lmhosts file because the servers learn address mappings dynamically from clients and other servers. NetBIOS names are self-registered; clients register their NetBIOS names with the server when they boot. The addresses and names are stored in the WINS database; wins.dat. lmhosts is only a small part of the total database.

The lmhosts Files

The lmhosts file contains static-name-to-address mappings. The file is similar to the hosts file described in Chapter 4, "Linux Name Services." Each entry begins with an IP address that is followed by a hostname. However, this time the hostname is the NetBIOS name. Listing 9.8 is a sample lmhosts file.

Listing 9.8: A Sample lmhosts File

$ cat /etc/lmhosts

172.16.5.5 crow

172.16.5.1 wren

172.16.5.2 robin 172.16.5.4 hawk

Given this lmhosts file, the NetBIOS name robin maps to the IP address 172.16.5.2. Notice that these NetBIOS names are the same as the TCP/IP hostnames assigned to these clients. You should always use the same hostnames for your systems for both NetBIOS and TCP/IP. Doing otherwise limits your configuration choices and creates confusion.

NetBIOS name service is an essential part of a NetBIOS network, but the real point of creating such a network is to share files and other network resources. The remainder of this chapter discusses installing and configuring Samba to do just that.

Was this article helpful?

0 0

Responses

  • Biagio Lombardi
    How to check NetBIOS name on a linux server?
    7 months ago

Post a comment