|
5.2. Enabling NBNS FunctionsName resolutionconverting computer names into IP addressesis a problem that must be solved with any networking system. NetBIOS supports several methods of name resolution. One of these, the use of a NetBIOS Name Server (NBNS) system, is often associated with running a domain controller, although you don't need a domain configuration to use NBNS. Naturally, Samba can function as an NBNS system. Doing so requires setting just a couple of Samba options; the rest is fairly automatic, from Samba's perspective. Client configuration may be another matter, though; you must know how to tell clients to use the NBNS system. 5.2.1. The Role of the NBNS SystemNetBIOS and Samba support several methods of name resolution, as described in Chapter 3. The simplest of these to configure is broadcast name resolution, in which computers needing to contact other computers broadcast the names, and the so-named computers respond to these broadcasts. Windows systems use broadcast name resolution by default. Broadcasts work well on small networks with just one subnet, but in a multisubnet configuration, broadcasts are typically blocked at the routers between subnets. Thus, other methods are used in such situations. One type of solution to this problem is to use an NBNS computer. The NBNS system fills a role similar to that of a DNS server, but the NBNS system is specific to NetBIOS name resolution. It listens for name registrations from clients, caches them, and then delivers those names to other clients who ask for them. Because clients are told where to find NBNS systems, broadcasts aren't needed in NBNS-based name resolution. This means that NBNS is a superior name resolution system when a network spans multiple subnets. NBNS-based name resolution is designed to work in a conceptually similar way to broadcast name resolution, in that clients register the names they want to use. Unlike a DNS server (described in Chapter 15), there's no need to explicitly tell an NBNS system about the names or IP addresses it's to share. If your network uses the Dynamic Host Configuration Protocol (DHCP) to deliver IP addresses to computers, they may change from time to time. An NBNS system automatically tracks these changes.
5.2.2. Defining Samba NBNS FunctionsBecause the name resolution features of SMB/CIFS, including NBNS functions, were designed to work fairly automatically, Samba provides relatively few options related to these features. Only one option is required to activate NBNS features, although a few more will help fine-tune the operation:
Overall, the NBNS system only needs to have wins support = Yes set; additional options just tweak the operation of the server. You should set this option on one server only; configuring multiple servers as NBNS systems is likely to cause confusion unless they can communicate with one another, which Samba doesn't supportat least as of the early 3.0.x versions. If two different clients are configured to use two different NBNS servers, they won't be able to locate each other via these servers, and possibly not at all if they aren't configured to use broadcasts as fallback or if they aren't on the same subnet. 5.2.3. Delivering NBNS Information via DHCPJust as with DNS, the clients of NBNS systems must know how to contact their servers. Also just as with DNS, this task is accomplished by giving the clients the IP addresses of their servers. You can do this by entering the information on each client manually, but if your network uses DHCP, a simpler solution is to deliver the information via DHCP. (Even in this case, some client configuration may be necessary.)
5.2.3.1 DHCP server configurationIf your network uses DHCP for assigning IP addresses to Windows systems, the simplest way to configure those systems to use your NBNS system is to deliver the information via DHCP. Doing so requires modifying your DHCP server's configuration, though. Chapter 15 describes DHCP configuration generally, so you should consult that chapter first if you need to get your DHCP system operational. This section assumes you're using the Internet Software Consortium's (ISC) DHCP server, which is the most common one on Linux systems. Its configuration file is usually called /etc/dhcpd.conf, although it's likely to be stored in /usr/local/etc if you compile it from source rather than install it via a package for your Linux distribution.
The /etc/dhcpd.conf file is composed of several parts. At the top of the file are a series of global options. Chances are you'll include the NBNS options with these. The configuration file is likely to contain one or more declarations for particular subnets, which begin with the subnet keyword and include options for the subnet within lines delimited by curly braces ({ }). If you want to configure different NBNS servers for separate domains on different subnets, you can place the configuration options within these subnet declarations. In any event, to point DHCP clients at your NBNS system, add these lines: option netbios-name-servers 192.168.1.1; option netbios-node-type 8; The first of these options specifies the IP addresses of your NetBIOS name servers. You would change the IP address as appropriate for your network, of course. Although the ISC DHCP server supports delivering multiple NBNS addresses (separated by commas), you're likely to deliver one only if you use Samba as an NBNS system, because Samba doesn't yet support exchanging NetBIOS name information with other Samba servers, so you're effectively limited to one NBNS system. The netbios-node-type option specifies a code for the order in which the client attempts various lookup methods. Specifically, passing 1 as this value tells clients to use broadcasts alone; 2 means to use the NBNS system alone; 4 means to try broadcasts first and then to try the NBNS system if the broadcast fails; and 8 means to try the NBNS system and then to use broadcasts if the NBNS attempt fails. In most cases, 8 is the appropriate option. Once you've made these changes, you need to restart the DHCP server. In most cases, passing restart to a SysV startup script, as in /etc/init.d/dhcpd restart, does the trick. 5.2.3.2 Windows client configurationUnless they're told otherwise, Windows clients use broadcast name resolution by default. Even if you configure DHCP to deliver NBNS information to clients, Windows 9x/Me systems ignore this information by default, so you must make a change to such systems' configurations to have them use DHCP-provided information. Windows NT/200x/XP, though, uses DHCP-provided information by default. Thus, you may not need to change these clients' configurations if you configure a DHCP server to deliver NBNS information.
To set NBNS information in a Windows 9x/Me client, follow these steps:
Windows must be restarted for the changes to take effect, and it should prompt you to do so. After the restart, Windows should use your NBNS system for name resolution. If you use Windows NT 4.0, the method of setting the NBNS system is similar to that in Windows 9x/Me, although there are a few differences. For instance, you must select the tab called WINS Address rather than WINS Configuration, and the field in which you enter an NBNS system's IP address is configured slightly differently. Windows 200x and XP use a substantially different way to specify NBNS information. These OSs use the information delivered by the DHCP server by default, so you shouldn't need to adjust them if you use this method. If you must specify IP addresses explicitly, though, you can do so:
|
|