oreilly.comSafari Books Online.Conferences.


Name Resolution and Browsing in Samba, Part 1
Pages: 1, 2

Setting Up Samba to Use Another WINS Server

You can configure Samba to use a WINS server somewhere else on the network by simply providing it with the IP address of the WINS server. This is done with the global wins server configuration option, as shown here:

	wins server =

With this option enabled, Samba will direct all WINS requests to the server located at Note that because the request is directed at a single machine, we don't have to worry about any of the problems inherent in broadcasting. However, Samba will not necessarily use the WINS server before other forms of name resolution. The order in which Samba attempts various name-resolution techniques is given with the name resolve order configuration option, which we discussed earlier.

The wins support and the wins server parameters are mutually exclusive; you cannot simultaneously offer Samba as the WINS server and use another system as the server! Typically, one Samba server is set up as the WINS server using wins support, and all other Samba servers are configured with the wins server parameter pointing to the Samba WINS server.

Configuring a WINS proxy

If you have a Samba server on a subnet that doesn't have a WINS server, and the Samba server has been configured with a WINS server on another subnet, you can tell the Samba server to forward any name-resolution requests with the wins proxy option:

	wins server =
	wins proxy = yes

Use this only in situations where the WINS server resides on another subnet. Otherwise, the broadcast will reach the WINS server regardless of any proxying.

Name-Resolution Configuration Options

Samba's name-resolution options are shown in Table 7-1.

Table 7-1: Name-resolution options

Option Parameters Function Default Scope
wins support boolean If set to yes, allows Samba to act as a WINS server no Global
wins server string (IP address or DNS name) Identifies a WINS server for Samba to use for name registration and resolution None Global
wins proxy boolean Allows Samba to act as a proxy to a WINS server on another subnet no Global
wins hook string Command to run when the WINS database changes None Global
dns proxy boolean If set to yes, allows a Samba WINS server to search DNS if it cannot find a name in WINS no Global
name resolve order string The order of methods used to resolve NetBIOS names lmhosts hosts wins bcast Global
max ttl numeric Maximum TTL in seconds for a requested NetBIOS name 259200
( 3 days)
max wins ttl numeric Maximum TTL in seconds for NetBIOS names given out by Samba as a WINS server 518400
(6 days)
min wins ttl numeric Minimum TTL in seconds for NetBIOS names given out by Samba as a WINS server 21600
(6 hours)

wins support

Samba will provide WINS name service to all machines in the network if you set the following in the [global] section of the smb.conf file:

    wins support = yes

The default value is no, which is typically used to allow a Windows NT/2000 server or another Samba server to be the WINS server. If you enable this option, remember that a Samba WINS server currently cannot exchange data with other WINS servers, so do not allow any other WINS servers on the network. When set to yes, this option is mutually exclusive with the wins server parameter.

wins server

Samba will use an existing WINS server on the network if you specify the wins server global option in your configuration file. The value of this option is either the IP address or DNS name (not NetBIOS name) of the WINS server. For example:

    wins server =


    wins server =

For this option to work, the wins support option must be set to no (the default). Otherwise, Samba will report an error. You can specify only one WINS server using this option.

wins proxy

This option allows Samba to act as a proxy to another WINS server, and thus relay name registration and resolution requests from itself to the real WINS server, often outside the current subnet. The WINS server can be indicated through the wins server option. The proxy will then return the WINS response back to the client. You can enable this option by specifying the following in the [global] section:

    wins proxy = yes

wins hook

This option allows you to run a script or other program whenever the WINS database is modified. One application might be to set up another Samba server to act as a backup for another Samba WINS server. This is done by having the wins hook script call rsync to synchronize the WINS databases (/usr/local/samba/var/locks/wins.dat) on the two systems whenever an entry is added or deleted. The script would be specified in the Samba configuration file like this:

    wins hook = /usr/local/bin/sync_wins

dns proxy

If you want the DNS to be used if a NetBIOS name isn't found in WINS, you can set the following option:

    dns proxy = yes

This will permit nmbd to query the server's standard DNS. You might wish to deactivate this option if you do not have a permanent connection to your DNS server. This option should not be used in place of a DNS server on your network; it is intended for resolving NetBIOS names rather than fully qualified Internet domain names.

name resolve order

The global name resolve order option specifies the order of services that Samba will use in performing name resolution. The default order is to use the lmhosts file, followed by standard Unix name-resolution methods (some combination of /etc/hosts, DNS, and NIS), then to query a WINS server, and finally to use broadcasting to determine the address of a NetBIOS name. You can override this option by specifying something like the following:

    name resolve order = lmhosts wins hosts bcast

This causes resolution to use the lmhosts file first, followed by a query to a WINS server, the /etc/hosts file, and finally broadcasting. You need not use all four options. This option is covered in more detail in the section "Setting Up Samba as a WINS Server," earlier in this chapter.

max ttl

This option is used when Samba is not acting as a WINS server but is using another system on the network for its WINS server. It sets the maximum T T L for NetBIOS names registered by the Samba server with the WINS server. You should never need to alter this value.

max wins ttl

This option is used when Samba is providing WINS name service, and it sets the maximum T T L for NetBIOS names registered with Samba. You should never need to change this value from its default.

min wins ttl

This option is used when Samba is providing WINS name service, and it sets the minimum T T L for NetBIOS names registered with Samba. You should never need to alter this value from its default.

Check back here next week for Part 2 of this excerpt, which will cover browsing in Samba.

1. As we explained in Chapter 1, a system can register under more than one NetBIOS name. We use the singular here only to keep our explanation simple.

Return to

Sponsored by: