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
server configuration option, as shown here:
[global] wins server = 172.16.1.1
With this option enabled, Samba will direct all WINS requests to the server located at 172.16.1.1. 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
order configuration option, which we discussed earlier.
support and the
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
support, and all other Samba servers are configured with the
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
[global] wins server = 172.16.200.12 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
||boolean||If set to
||string (IP address or DNS name)||Identifies a WINS server for Samba to use for name registration and resolution||None||Global|
||boolean||Allows Samba to act as a proxy to a WINS server on another subnet||
||string||Command to run when the WINS database changes||None||Global|
||boolean||If set to
||string||The order of methods used to resolve NetBIOS names||
||numeric||Maximum TTL in seconds for a requested NetBIOS name||
( 3 days)
||numeric||Maximum TTL in seconds for NetBIOS names given out by Samba as a WINS server||
||numeric||Minimum TTL in seconds for NetBIOS names given out by Samba as a WINS server||
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:
[global] 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
Samba will use an existing WINS server on the network if you specify the
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:
[global] wins server = 172.16.220.110
[global] wins server = wins.metran.cx
For this option to work, the
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.
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
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] wins proxy = yes
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
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:
[global] wins hook = /usr/local/bin/sync_wins
If you want the DNS to be used if a NetBIOS name isn't found in WINS, you can set the following option:
[global] 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
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:
[global] 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.
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 ONLamp.com.