1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="NetworkBrowsing">
7 <pubdate>July 5, 1998</pubdate>
8 <pubdate>Updated: April 21, 2003</pubdate>
11 <title>Network Browsing</title>
14 <indexterm><primary>browsing across subnets</primary></indexterm>
15 <indexterm><primary>resolution of NetBIOS names</primary></indexterm>
16 <indexterm><primary>browse list handling</primary></indexterm>
17 This chapter contains detailed information as well as a fast-track guide to
18 implementing browsing across subnets and/or across workgroups (or domains).
19 WINS is the best tool for resolution of NetBIOS names to IP addresses; however, WINS is
20 not involved in browse list handling except by way of name-to-address resolution.
24 <indexterm><primary>Windows 2000</primary></indexterm>
25 <indexterm><primary>NetBIOS over TCP/IP</primary></indexterm>
26 <indexterm><primary>DNS</primary></indexterm>
27 <indexterm><primary>ADS</primary></indexterm>
28 MS Windows 2000 and later versions can be configured to operate with no NetBIOS
29 over TCP/IP. Samba-3 and later versions also support this mode of operation.
30 When the use of NetBIOS over TCP/IP has been disabled, the primary
31 means for resolution of MS Windows machine names is via DNS and Active Directory.
32 The following information assumes that your site is running NetBIOS over TCP/IP.
36 <title>Features and Benefits</title>
39 Charles Dickens once referred to the past in these words: <quote><emphasis>It was the best of times,
40 it was the worst of times.</emphasis></quote> The more we look back, the more we long for what was and
41 hope it never returns.
46 <indexterm><primary>NetBIOS</primary></indexterm>
47 <indexterm><primary>NetBIOS networking</primary></indexterm>
48 <indexterm><primary>fickle</primary></indexterm>
49 For many MS Windows network administrators, that statement sums up their feelings about
50 NetBIOS networking precisely. For those who mastered NetBIOS networking, its fickle
51 nature was just par for the course. For those who never quite managed to tame its
52 lusty features, NetBIOS is like Paterson's Curse.
56 For those not familiar with botanical problems in Australia, Paterson's Curse,
57 <emphasis>Echium plantagineum</emphasis>, was introduced to Australia from Europe during the mid-19th
58 century. Since then it has spread rapidly. The high seed production, with densities of
59 thousands of seeds per square meter, a seed longevity of more than 7 years, and an
60 ability to germinate at any time of year, given the right conditions, are some of the
61 features that make it such a persistent weed.
65 <indexterm><primary>Network Basic Input/Output System</primary><see>NetBIOS</see></indexterm>
66 <indexterm><primary>SMB</primary></indexterm>
67 <indexterm><primary>NetBIOS</primary></indexterm>
68 <indexterm><primary>TCP/IP</primary></indexterm>
69 <indexterm><primary>Windows network clients</primary></indexterm>
70 In this chapter we explore vital aspects of Server Message Block (SMB) networking with
71 a particular focus on SMB as implemented through running NetBIOS (Network Basic
72 Input/Output System) over TCP/IP. Since Samba does not implement SMB or NetBIOS over
73 any other protocols, we need to know how to configure our network environment and simply
74 remember to use nothing but TCP/IP on all our MS Windows network clients.
78 <indexterm><primary>WINS</primary></indexterm>
79 <indexterm><primary>MS WINS</primary></indexterm>
80 Samba provides the ability to implement a WINS (Windows Internetworking Name Server)
81 and implements extensions to Microsoft's implementation of WINS. These extensions
82 help Samba to effect stable WINS operations beyond the normal scope of MS WINS.
86 <indexterm><primary>NetBIOS over TCP/IP</primary></indexterm>
87 <indexterm><primary>NetBIOS disabled</primary></indexterm>
88 <indexterm><primary>WINS</primary></indexterm>
89 WINS is exclusively a service that applies only to those systems
90 that run NetBIOS over TCP/IP. MS Windows 200x/XP have the capacity to operate with
91 support for NetBIOS disabled, in which case WINS is of no relevance. Samba supports this also.
95 <indexterm><primary>NetBIOS disabled</primary></indexterm>
96 <indexterm><primary>DNS</primary></indexterm>
97 <indexterm><primary>WINS</primary></indexterm>
98 For those networks on which NetBIOS has been disabled (i.e., WINS is not required),
99 the use of DNS is necessary for hostname resolution.
105 <title>What Is Browsing?</title>
108 <indexterm><primary>browsing</primary></indexterm>
109 <indexterm><primary>Network Neighborhood</primary></indexterm>
110 <indexterm><primary>shares</primary></indexterm>
111 <indexterm><primary>printers available</primary></indexterm>
112 To most people, browsing means they can see the MS Windows and Samba servers
113 in the Network Neighborhood, and when the computer icon for a particular server is
114 clicked, it opens up and shows the shares and printers available on the target server.
118 What seems so simple is in fact a complex interaction of different technologies.
119 The technologies (or methods) employed in making all of this work include:
123 <listitem><para>MS Windows machines register their presence to the network.</para></listitem>
124 <listitem><para>Machines announce themselves to other machines on the network.</para></listitem>
125 <listitem><para>One or more machines on the network collate the local announcements.</para></listitem>
126 <listitem><para>The client machine finds the machine that has the collated list of machines.</para></listitem>
127 <listitem><para>The client machine is able to resolve the machine names to IP addresses.</para></listitem>
128 <listitem><para>The client machine is able to connect to a target machine.</para></listitem>
132 <indexterm><primary>browse list management</primary></indexterm>
133 <indexterm><primary>name resolution</primary></indexterm>
134 <indexterm><primary>nmbd</primary></indexterm>
135 The Samba application that controls browse list management and name resolution is
136 called <filename>nmbd</filename>. The configuration parameters involved in nmbd's operation are:
143 <listitem><smbconfoption name="os level"/></listitem>
144 <listitem><smbconfoption name="lm announce"/></listitem>
145 <listitem><smbconfoption name="lm interval"/></listitem>
146 <listitem><smbconfoption name="preferred master"/>(*)</listitem>
147 <listitem><smbconfoption name="local master"/>(*)</listitem>
148 <listitem><smbconfoption name="domain master"/>(*)</listitem>
149 <listitem><smbconfoption name="browse list"/></listitem>
150 <listitem><smbconfoption name="enhanced browsing"/></listitem>
154 Name Resolution Method:
157 <listitem><smbconfoption name="name resolve order"/>(*)</listitem>
164 <listitem><smbconfoption name="dns proxy"/></listitem>
165 <listitem><smbconfoption name="wins proxy"/></listitem>
166 <listitem><smbconfoption name="wins server"/>(*)</listitem>
167 <listitem><smbconfoption name="wins support"/>(*)</listitem>
168 <listitem><smbconfoption name="wins hook"/></listitem>
172 Those marked with an (*) are the only options that commonly may need to be modified. Even if none of these
173 parameters is set, <filename>nmbd</filename> will still do its job.
177 <indexterm><primary>WINS</primary></indexterm>
178 <indexterm><primary>WINS Server</primary></indexterm>
179 <indexterm><primary>WINS Support</primary></indexterm>
180 <indexterm><primary>nmbd</primary></indexterm>
181 <indexterm><primary>mutually exclusive options</primary></indexterm>
182 For Samba, the WINS Server and WINS Support are mutually exclusive options. When <command>nmbd</command> is
183 started it will fail to execute if both options are set in the &smb.conf; file. The <command>nmbd</command>
184 understands that when it spawns an instance of itself to run as a WINS server that it has to use its own WINS
190 <sect1 id="netdiscuss">
191 <title>Discussion</title>
194 <indexterm><primary>SMB-based messaging</primary></indexterm>
195 <indexterm><primary>NetBIOS</primary></indexterm>
196 <indexterm><primary>NetBIOS</primary></indexterm>
197 <indexterm><primary>phasing out NetBIOS</primary></indexterm>
198 All MS Windows networking uses SMB-based messaging. SMB messaging may be implemented with or without NetBIOS.
199 MS Windows 200x supports NetBIOS over TCP/IP for backwards compatibility. Microsoft appears intent on phasing
204 <title>NetBIOS over TCP/IP</title>
207 <indexterm><primary>encapsulating</primary></indexterm>
208 <indexterm><primary>broadcast</primary></indexterm>
209 <indexterm><primary>unicast</primary></indexterm>
210 <indexterm><primary>UDP</primary></indexterm>
211 Samba implements NetBIOS, as does MS Windows NT/200x/XP, by encapsulating it over TCP/IP.
212 NetBIOS-based networking uses broadcast messaging to effect browse list management. When running NetBIOS over
213 TCP/IP, this uses UDP-based messaging. UDP messages can be broadcast or unicast.
217 <indexterm><primary>UDP</primary></indexterm>
218 Normally, only unicast UDP messaging can be forwarded by routers. The
219 <smbconfoption name="remote announce"/> parameter to smb.conf helps to project browse announcements
220 to remote network segments via unicast UDP. Similarly, the
221 <smbconfoption name="remote browse sync"/> parameter of &smb.conf;
222 implements browse list collation using unicast UDP.
226 The methods used by MS Windows to perform name lookup requests (name resolution) is determined by a
227 configuration parameter called the NetBIOS node-type. There are four basic NetBIOS node types:
230 <indexterm><primary>b-node</primary></indexterm>
231 <indexterm><primary>p-node</primary></indexterm>
232 <indexterm><primary>m-node</primary></indexterm>
233 <indexterm><primary>h-node</primary></indexterm>
234 <indexterm><primary>node-type</primary></indexterm>
235 <indexterm><primary>WINS</primary></indexterm>
236 <indexterm><primary>broadcast</primary></indexterm>
237 <indexterm><primary>unicast</primary></indexterm>
239 <listitem><para><emphasis>b-node (type 0x01):</emphasis> The Windows client will use only
240 NetBIOS broadcast requests using UDP broadcast.</para></listitem>
241 <listitem><para><emphasis>p-node (type 0x02):</emphasis> The Windows client will use point-to-point
242 (NetBIOS unicast) requests using UDP unicast directed to a WINS server.</para></listitem>
243 <listitem><para><emphasis>m-node (type 0x04):</emphasis> The Windows client will first use
244 NetBIOS broadcast requests using UDP broadcast, then it will use (NetBIOS unicast)
245 requests using UDP unicast directed to a WINS server.</para></listitem>
246 <listitem><para><emphasis>h-node (type 0x08):</emphasis> The Windows client will use
247 (NetBIOS unicast) requests using UDP unicast directed to a WINS server, then it will use
248 NetBIOS broadcast requests using UDP broadcast.</para></listitem>
252 <indexterm><primary>h-node</primary></indexterm>
253 <indexterm><primary>hybrid</primary></indexterm>
254 <indexterm><primary>enables NetBIOS over TCP/IP</primary></indexterm>
255 <indexterm><primary>WINS</primary></indexterm>
256 <indexterm><primary>broadcast-based</primary></indexterm>
257 <indexterm><primary>name resolution</primary></indexterm>
258 The default Windows network client (or server) network configuration enables NetBIOS over TCP/IP
259 and b-node configuration. The use of WINS makes most sense with h-node (hybrid mode) operation so that
260 in the event of a WINS breakdown or non-availability, the client can use broadcast-based name resolution.
264 <indexterm><primary>LMB</primary><see>Local Master Browser</see></indexterm>
265 <indexterm><primary>Local Master Browser</primary></indexterm>
266 <indexterm><primary>SMB</primary></indexterm>
267 <indexterm><primary>nmbd</primary></indexterm>
268 <indexterm><primary>WINS</primary></indexterm>
269 <indexterm><primary>cross-segment browsing</primary></indexterm>
270 <indexterm><primary>network segment</primary></indexterm>
271 In those networks where Samba is the only SMB server technology, wherever possible <filename>nmbd</filename>
272 should be configured on one machine as the WINS server. This makes it easy to manage the browsing environment.
273 If each network segment is configured with its own Samba WINS server, then the only way to get cross-segment
274 browsing to work is by using the <smbconfoption name="remote announce"/> and the <smbconfoption name="remote
275 browse sync"/> parameters to your &smb.conf; file.
279 <indexterm><primary>WINS</primary></indexterm>
280 If only one WINS server is used for an entire multisegment network, then
281 the use of the <smbconfoption name="remote announce"/> and the
282 <smbconfoption name="remote browse sync"/> parameters should not be necessary.
286 <indexterm><primary>replication</primary><secondary>WINS</secondary></indexterm>
287 As of Samba-3, WINS replication is being worked on. The bulk of the code has been committed, but it still
288 needs maturation. This is not a supported feature of the Samba-3.0.20 release. Hopefully, this will become a
289 supported feature of one of the Samba-3 release series. The delay is caused by the fact that this feature has
290 not been of sufficient significance to inspire someone to pay a developer to complete it.
294 <indexterm><primary>WINS</primary></indexterm>
295 <indexterm><primary>MS-WINS replication</primary></indexterm>
296 <indexterm><primary>redundancy</primary></indexterm>
297 <indexterm><primary>DNS</primary></indexterm>
298 <indexterm><primary>NetBIOSless SMB over TCP/IP</primary></indexterm>
299 <indexterm><primary>local names</primary></indexterm>
300 <indexterm><primary>subnets</primary></indexterm>
301 <indexterm><primary>multiple WINS servers</primary></indexterm>
302 Right now Samba WINS does not support MS-WINS replication. This means that when setting up Samba as a WINS
303 server, there must only be one <filename>nmbd</filename> configured as a WINS server on the network. Some
304 sites have used multiple Samba WINS servers for redundancy (one server per subnet) and then used
305 <smbconfoption name="remote browse sync"/> and <smbconfoption name="remote announce"/> to effect browse list
306 collation across all segments. Note that this means clients will only resolve local names and must be
307 configured to use DNS to resolve names on other subnets in order to resolve the IP addresses of the servers
308 they can see on other subnets. This setup is not recommended but is mentioned as a practical consideration
309 (i.e., an <quote>if all else fails</quote> scenario). NetBIOS over TCP/IP is an ugly and difficult to manage
310 protocol. Its replacement, NetBIOSless SMB over TCP/IP is not without its own manageability concerns. NetBIOS
311 based networking is a life of compromise and trade-offs. WINS stores information that can not be stored in
312 DNS; consequently, DNS is a poor substitute for WINS given that when NetBIOS over TCP/IP is used Windows
313 clients are designed to use WINS.
317 <indexterm><primary>broadcast messages</primary></indexterm>
318 <indexterm><primary>repeated intervals</primary></indexterm>
319 <indexterm><primary>across network segments</primary></indexterm>
320 Lastly, take note that browse lists are a collection of unreliable broadcast
321 messages that are repeated at intervals of not more than 15 minutes. This means
322 that it will take time to establish a browse list, and it can take up to 45
323 minutes to stabilize, particularly across network segments.
327 <indexterm><primary>Windows 200x/XP</primary></indexterm>
328 When an MS Windows 200x/XP system attempts to resolve a host name to an IP address, it follows a defined path:
333 Checks the <filename>hosts</filename> file. It is located in <filename>%SystemRoot%\System32\Drivers\etc</filename>.
341 Checks the NetBIOS name cache.
345 Queries the WINS server.
349 Does a broadcast name lookup over UDP.
353 Looks up entries in LMHOSTS, located in <filename>%SystemRoot%\System32\Drivers\etc</filename>.
358 <indexterm><primary>WINS</primary></indexterm>
359 <indexterm><primary>NetBIOS over TCP/IP</primary></indexterm>
360 <indexterm><primary>name lookups</primary></indexterm>
361 <indexterm><primary>DNS</primary></indexterm>
362 Given the nature of how the NetBIOS over TCP/IP protocol is implemented, only WINS is capable of resolving
363 with any reliability name lookups for service oriented names such as TEMPTATION<1C> &smbmdash; a NetBIOS
364 name query that seeks to find network logon servers. DNS has not concept of service oriented names such as
365 this. In fact, the Microsoft ADS implementation specifically manages a whole range of extended service
366 oriented DNS entries. This type of facility is not implemented and is not supported for the NetBIOS over
367 TCP/IP protocol name space.
373 <title>TCP/IP without NetBIOS</title>
376 <indexterm><primary>NetBIOS</primary></indexterm>
377 <indexterm><primary>NetBIOS-less</primary></indexterm>
378 <indexterm><primary>DNS</primary></indexterm>
379 All TCP/IP-enabled systems use various forms of hostname resolution. The primary
380 methods for TCP/IP hostname resolution involve either a static file (<filename>/etc/hosts</filename>)
381 or the Domain Name System (DNS). DNS is the technology that makes
382 the Internet usable. DNS-based hostname resolution is supported by nearly all
383 TCP/IP-enabled systems. Only a few embedded TCP/IP systems do not support DNS.
387 <indexterm><primary>DNS</primary></indexterm>
388 <indexterm><primary>DDNS</primary></indexterm>
389 <indexterm><primary>ipconfig</primary></indexterm>
390 <indexterm><primary>Dynamic DNS</primary><see>DDNS</see></indexterm>
391 Windows 200x/XP can register its hostname with a Dynamic DNS server (DDNS). It is possible to force register with a
392 dynamic DNS server in Windows 200x/XP using <command>ipconfig /registerdns</command>.
396 <indexterm><primary>ADS</primary></indexterm>
397 <indexterm><primary>DNS</primary></indexterm>
398 <indexterm><primary>severely impaired</primary></indexterm>
399 With Active Directory, a correctly functioning DNS server is absolutely essential. In the absence of a working
400 DNS server that has been correctly configured, MS Windows clients and servers will be unable to locate each
401 other, so network services consequently will be severely impaired.
405 <indexterm><primary>raw SMB over TCP/IP</primary></indexterm>
406 <indexterm><primary>No NetBIOS layer</primary></indexterm>
407 <indexterm><primary>NetBIOS</primary></indexterm>
408 <indexterm><primary>domain member server</primary></indexterm>
409 <indexterm><primary>DNS</primary></indexterm>
410 <indexterm><primary>ADS</primary></indexterm>
411 Use of raw SMB over TCP/IP (No NetBIOS layer) can be done only with Active Directory domains. Samba is not an
412 Active Directory domain controller: ergo, it is not possible to run Samba as a domain controller and at the same
413 time <emphasis>not</emphasis> use NetBIOS. Where Samba is used as an Active Directory domain member server
414 (DMS) it is possible to configure Samba to not use NetBIOS over TCP/IP. A Samba DMS can integrate fully into
415 an Active Directory domain, however, if NetBIOS over TCP/IP is disabled it is necessary manually to create
416 appropriate DNS entries for the Samba DMS because they will not be automatically generated either by Samba, or
417 by the ADS environment.
422 <sect2 id="adsdnstech">
423 <title>DNS and Active Directory</title>
426 <indexterm><primary>DNS</primary><secondary>Active Directory</secondary></indexterm>
427 <indexterm><primary>DDNS</primary></indexterm>
428 <indexterm><primary>ADS</primary></indexterm>
429 <indexterm><primary>SRV records</primary></indexterm>
430 <indexterm><primary>DNS</primary><secondary>SRV records</secondary></indexterm>
431 Occasionally we hear from UNIX network administrators who want to use a UNIX-based DDNS server in place
432 of the Microsoft DNS server. While this might be desirable to some, the MS Windows 200x DNS server is
433 autoconfigured to work with Active Directory. It is possible to use BIND version 8 or 9, but it will almost
434 certainly be necessary to create service records (SRV records) so MS Active Directory clients can resolve
435 hostnames to locate essential network services. The following are some of the default service records that
436 Active Directory requires:
440 <indexterm><primary>DDNS</primary></indexterm>
441 <indexterm><primary>ADS</primary></indexterm>
442 <indexterm><primary>BIND9</primary></indexterm>
443 The use of DDNS is highly recommended with Active Directory, in which case the use of BIND9 is preferred for
444 its ability to adequately support the SRV (service) records that are needed for Active Directory. Of course,
445 when running ADS it makes sense to use Microsoft's own DDNS server because of the natural affinity between ADS
451 <term>_ldap._tcp.pdc._msdcs.<emphasis>Domain</emphasis></term>
454 This provides the address of the Windows NT PDC for the domain.
459 <term>_ldap._tcp.pdc._msdcs.<emphasis>DomainTree</emphasis></term>
462 Resolves the addresses of global catalog servers in the domain.
467 <term>_ldap._tcp.<emphasis>site</emphasis>.sites.writable._msdcs.<emphasis>Domain</emphasis></term>
470 Provides list of domain controllers based on sites.
475 <term>_ldap._tcp.writable._msdcs.<emphasis>Domain</emphasis></term>
478 Enumerates list of domain controllers that have the writable copies of the Active Directory data store.
483 <term>_ldap._tcp.<emphasis>GUID</emphasis>.domains._msdcs.<emphasis>DomainTree</emphasis></term>
486 Entry used by MS Windows clients to locate machines using the global unique identifier.
491 <term>_ldap._tcp.<emphasis>Site</emphasis>.gc._msdcs.<emphasis>DomainTree</emphasis></term>
494 Used by MS Windows clients to locate site configuration-dependent global catalog server.
501 Specific entries used by Microsoft clients to locate essential services for an example domain
502 called <constant>quenya.org</constant> include:
507 _kerberos._udp.quenya.org &smbmdash; Used to contact the KDC server via UDP.
508 This entry must list port 88 for each KDC.
512 _kpasswd._udp.quenya.org &smbmdash; Used to locate the <constant>kpasswd</constant> server
513 when a user password change must be processed. This record must list port 464 on the
518 _kerberos._tcp.quenya.org &smbmdash; Used to locate the KDC server via TCP.
519 This entry must list port 88 for each KDC.
523 _ldap._tcp.quenya.org &smbmdash; Used to locate the LDAP service on the PDC.
524 This record must list port 389 for the PDC.
528 _kpasswd._tcp.quenya.org &smbmdash; Used to locate the <constant>kpasswd</constant> server
529 to permit user password changes to be processed. This must list port 464.
533 _gc._tcp.quenya.org &smbmdash; Used to locate the global catalog server for the
534 top of the domain. This must list port 3268.
539 The following records are also used by the Windows domain member client to locate vital
540 services on the Windows ADS domain controllers.
545 _ldap._tcp.pdc._msdcs.quenya.org
549 _ldap.gc._msdcs.quenya.org
553 _ldap.default-first-site-name._sites.gc._msdcs.quenya.org
557 _ldap.{SecID}.domains._msdcs.quenya.org
561 _ldap._tcp.dc._msdcs.quenya.org
565 _kerberos._tcp.dc._msdcs.quenya.org
569 _ldap.default-first-site-name._sites.dc._msdcs.quenya.org
573 _kerberos.default-first-site-name._sites.dc._msdcs.queyna.org
577 SecID._msdcs.quenya.org
582 Presence of the correct DNS entries can be validated by executing:
584 &rootprompt; dig @frodo -t any _ldap._tcp.dc._msdcs.quenya.org
586 ; <lt;>> DiG 9.2.2 <lt;>> @frodo -t any _ldap._tcp.dc._msdcs.quenya.org
587 ;; global options: printcmd
589 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3072
590 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2
594 ;_ldap._tcp.dc._msdcs.quenya.org. IN ANY
598 _ldap._tcp.dc._msdcs.quenya.org. 600 IN SRV 0 100 389 frodo.quenya.org.
599 _ldap._tcp.dc._msdcs.quenya.org. 600 IN SRV 0 100 389 noldor.quenya.org.
602 ;; ADDITIONAL SECTION:
603 frodo.quenya.org. 3600 IN A 10.1.1.16
604 noldor.quenya.org. 1200 IN A 10.1.1.17
607 ;; Query time: 0 msec
608 ;; SERVER: frodo#53(10.1.1.16)
609 ;; WHEN: Wed Oct 7 14:39:31 2004
610 ;; MSG SIZE rcvd: 171
619 <title>How Browsing Functions</title>
622 <indexterm><primary>register NetBIOS names</primary></indexterm>
623 <indexterm><primary>LMHOSTS</primary></indexterm>
624 <indexterm><primary>DNS</primary></indexterm>
625 <indexterm><primary>WINS</primary></indexterm>
626 <indexterm><primary>WINS server address</primary></indexterm>
627 MS Windows machines register their NetBIOS names (i.e., the machine name for each service type in operation)
628 on startup. The exact method by which this name registration takes place is determined by whether or not the
629 MS Windows client/server has been given a WINS server address, whether or not LMHOSTS lookup is enabled,
630 whether or not DNS for NetBIOS name resolution is enabled, and so on.
634 <indexterm><primary>WINS server</primary></indexterm>
635 <indexterm><primary>name lookups</primary></indexterm>
636 <indexterm><primary>UDP</primary></indexterm>
637 In the case where there is no WINS server, all name registrations as well as name lookups are done by UDP
638 broadcast. This isolates name resolution to the local subnet, unless LMHOSTS is used to list all names and IP
639 addresses. In such situations, Samba provides a means by which the Samba server name may be forcibly injected
640 into the browse list of a remote MS Windows network (using the <smbconfoption name="remote announce"/>
645 <indexterm><primary>WINS</primary></indexterm>
646 <indexterm><primary>UDP unicast</primary></indexterm>
647 <indexterm><primary>name resolution across routed networks</primary></indexterm>
648 Where a WINS server is used, the MS Windows client will use UDP unicast to register with the WINS server. Such
649 packets can be routed, and thus WINS allows name resolution to function across routed networks.
653 <indexterm><primary>LMB</primary></indexterm>
654 <indexterm><primary>local master browser</primary><see>LMB</see></indexterm>
655 <indexterm><primary>WINS</primary></indexterm>
656 <indexterm><primary>LMHOSTS</primary></indexterm>
657 <indexterm><primary>DMB</primary></indexterm>
658 <indexterm><primary>browse list</primary></indexterm>
659 <indexterm><primary>election</primary></indexterm>
660 <indexterm><primary>election criteria</primary></indexterm>
661 During the startup process, an election takes place to create a local master browser (LMB) if one does not
662 already exist. On each NetBIOS network one machine will be elected to function as the domain master browser
663 (DMB). This domain browsing has nothing to do with MS security Domain Control. Instead, the DMB serves the
664 role of contacting each LMB (found by asking WINS or from LMHOSTS) and exchanging browse list contents. This
665 way every master browser will eventually obtain a complete list of all machines that are on the network. Every
666 11 to 15 minutes an election is held to determine which machine will be the master browser. By the nature of
667 the election criteria used, the machine with the highest uptime, or the most senior protocol version or other
668 criteria, will win the election as DMB.
672 <indexterm><primary>WINS server</primary></indexterm>
673 <indexterm><primary>DMB</primary></indexterm>
674 <indexterm><primary>NetBIOS name type</primary></indexterm>
675 <indexterm><primary>n security context</primary></indexterm>
676 <indexterm><primary>network segment</primary></indexterm>
677 <indexterm><primary>authoritive</primary></indexterm>
678 <indexterm><primary>browse list maintainers</primary></indexterm>
679 <indexterm><primary>LMB</primary></indexterm>
680 Where a WINS server is used, the DMB registers its IP address with the WINS server using the name of the
681 domain and the NetBIOS name type 1B. e.g., DOMAIN<1B>. All LMBs register their IP address with the WINS
682 server, also with the name of the domain and the NetBIOS name type of 1D. The 1B name is unique to one
683 server within the domain security context, and only one 1D name is registered for each network segment.
684 Machines that have registered the 1D name will be authoritive browse list maintainers for the network segment
685 they are on. The DMB is responsible for synchronizing the browse lists it obtains from the LMBs.
689 <indexterm><primary>name resolution</primary></indexterm>
690 Clients wishing to browse the network make use of this list but also depend on the availability of correct
691 name resolution to the respective IP address or addresses.
695 <indexterm><primary>browsing intrinsics</primary></indexterm>
696 Any configuration that breaks name resolution and/or browsing intrinsics will annoy users because they will
697 have to put up with protracted inability to use the network services.
701 <indexterm><primary>forced synchronization</primary></indexterm>
702 <indexterm><primary>LMB</primary></indexterm>
703 <indexterm><primary>bridges networks</primary></indexterm>
704 <indexterm><primary>cross-subnet browsing</primary></indexterm>
705 <indexterm><primary>DNS</primary></indexterm>
706 <indexterm><primary>/etc/hosts</primary></indexterm>
707 Samba supports a feature that allows forced synchronization of browse lists across routed networks using the
708 <smbconfoption name="remote browse sync"/> parameter in the &smb.conf; file. This causes Samba to contact the
709 LMB on a remote network and to request browse list synchronization. This effectively bridges two networks that
710 are separated by routers. The two remote networks may use either broadcast-based name resolution or WINS-based
711 name resolution, but it should be noted that the <smbconfoption name="remote browse sync"/> parameter provides
712 browse list synchronization &smbmdash; and that is distinct from name-to-address resolution. In other words,
713 for cross-subnet browsing to function correctly, it is essential that a name-to-address resolution mechanism
714 be provided. This mechanism could be via DNS, <filename>/etc/hosts</filename>, and so on.
718 <title>Configuring Workgroup Browsing</title>
721 <indexterm><primary>cross-subnet browsing</primary></indexterm>
722 <indexterm><primary>DMB</primary></indexterm>
723 <indexterm><primary>PDC</primary></indexterm>
724 <indexterm><primary>LMB</primary></indexterm>
725 <indexterm><primary>isolated workgroup</primary></indexterm>
726 <indexterm><primary>workgroup</primary></indexterm>
727 To configure cross-subnet browsing on a network containing machines in a workgroup, not an NT domain, you need
728 to set up one Samba server to be the DMB (note that this is not the same as a Primary Domain Controller,
729 although in an NT domain the same machine plays both roles). The role of a DMB is to collate the browse lists
730 from LMB on all the subnets that have a machine participating in the workgroup. Without one machine configured
731 as a DMB, each subnet would be an isolated workgroup unable to see any machines on another subnet. It is the
732 presence of a DMB that makes cross-subnet browsing possible for a workgroup.
736 <indexterm><primary>DMB</primary></indexterm>
737 In a workgroup environment the DMB must be a Samba server, and there must only be one DMB per workgroup name.
738 To set up a Samba server as a DMB, set the following option in the <smbconfsection name="[global]"/> section
739 of the &smb.conf; file:
744 <smbconfoption name="domain master">yes</smbconfoption>
749 <indexterm><primary>DMB</primary></indexterm>
750 <indexterm><primary>LMB</primary></indexterm>
751 The DMB should preferably be the LMB for its own subnet. In order to achieve this, set the following options
752 in the <smbconfsection name="[global]"/> section of the &smb.conf; file as shown in <link
753 linkend="dmbexample">Domain Master Browser smb.conf</link>
756 <example id="dmbexample">
757 <title>Domain Master Browser smb.conf</title>
759 <smbconfsection name="[global]"/>
760 <smbconfoption name="domain master">yes</smbconfoption>
761 <smbconfoption name="local master">yes</smbconfoption>
762 <smbconfoption name="preferred master">yes</smbconfoption>
763 <smbconfoption name="os level">65</smbconfoption>
768 <indexterm><primary>DMB</primary></indexterm>
769 <indexterm><primary>WINS server</primary></indexterm>
770 The DMB may be the same machine as the WINS server, if necessary.
774 <indexterm><primary>subnets</primary></indexterm>
775 <indexterm><primary>LMB</primary></indexterm>
776 <indexterm><primary>rebooted</primary></indexterm>
777 Next, you should ensure that each of the subnets contains a machine that can act as an LMB for the workgroup.
778 Any MS Windows NT/200x/XP machine should be able to do this, as will Windows 9x/Me machines (although these
779 tend to get rebooted more often, so it is not such a good idea to use them). To make a Samba server an LMB,
780 set the following options in the <smbconfsection name="[global]"/> section of the &smb.conf; file as shown in
781 <link linkend="lmbexample">Local master browser smb.conf</link>
784 <example id="lmbexample">
785 <title>Local master browser smb.conf</title>
787 <smbconfsection name="[global]"/>
788 <smbconfoption name="domain master">no</smbconfoption>
789 <smbconfoption name="local master">yes</smbconfoption>
790 <smbconfoption name="preferred master">yes</smbconfoption>
791 <smbconfoption name="os level">65</smbconfoption>
796 <indexterm><primary>LMB</primary></indexterm>
797 Do not do this for more than one Samba server on each subnet, or they will war with
798 each other over which is to be the LMB.
802 <indexterm><primary>LMB</primary></indexterm>
803 <indexterm><primary>browser election</primary></indexterm>
804 The <smbconfoption name="local master"/> parameter allows Samba to act as a
805 LMB. The <smbconfoption name="preferred master"/> causes <command>nmbd</command>
806 to force a browser election on startup and the <smbconfoption name="os level"/>
807 parameter sets Samba high enough so it should win any browser elections.
811 <indexterm><primary>disable LMB</primary></indexterm>
812 If you have an NT machine on the subnet that you wish to be the LMB, you can disable Samba from
813 becoming an LMB by setting the following options in the <smbconfsection name="[global]"/> section of the
814 &smb.conf; file as shown in <link linkend="nombexample">smb.conf for Not Being a Master Browser</link>.
818 <example id="nombexample">
819 <title>smb.conf for Not Being a Master Browser</title>
821 <smbconfsection name="[global]"/>
822 <smbconfoption name="domain master">no</smbconfoption>
823 <smbconfoption name="local master">no</smbconfoption>
824 <smbconfoption name="preferred master">no</smbconfoption>
825 <smbconfoption name="os level">0</smbconfoption>
833 <title>Domain Browsing Configuration</title>
836 <indexterm><primary>DMB</primary></indexterm>
837 <indexterm><primary>PDC</primary></indexterm>
838 <indexterm><primary>registers</primary></indexterm>
839 <indexterm><primary>WINS</primary></indexterm>
840 If you are adding Samba servers to a Windows NT domain, then you must not set up a Samba server as a DMB. By
841 default, a Windows NT PDC for a domain is also the DMB for that domain. Network browsing may break if a Samba
842 server other than the PDC registers the DMB NetBIOS name (<replaceable>DOMAIN</replaceable><1B>) with
847 <indexterm><primary>Local Master Browser</primary></indexterm>
848 For subnets other than the one containing the Windows NT PDC, you may set up Samba servers as LMBs as
849 described. To make a Samba server a Local Master Browser, set the following options in the <smbconfsection
850 name="[global]"/> section of the &smb.conf; file as shown in <link linkend="remsmb">Local Master Browser
854 <example id="remsmb">
855 <title>Local Master Browser smb.conf</title>
857 <smbconfsection name="[global]"/>
858 <smbconfoption name="domain master">no</smbconfoption>
859 <smbconfoption name="local master">yes</smbconfoption>
860 <smbconfoption name="preferred master">yes</smbconfoption>
861 <smbconfoption name="os level">65</smbconfoption>
866 <indexterm><primary>election</primary></indexterm>
867 <indexterm><primary>LMB</primary></indexterm>
868 If you wish to have a Samba server fight the election with machines on the same subnet, you may set the
869 <smbconfoption name="os level"/> parameter to lower levels. By doing this you can tune the order of machines
870 that will become LMBs if they are running. For more details on this, refer to <link
871 linkend="browse-force-master">Forcing Samba to Be the Master</link>.
875 <indexterm><primary>domain members</primary></indexterm>
876 <indexterm><primary>browser elections</primary></indexterm>
877 <indexterm><primary>LMB</primary></indexterm>
878 If you have Windows NT machines that are members of the domain on all subnets and you are sure they will
879 always be running, you can disable Samba from taking part in browser elections and ever becoming an LMB by
880 setting the following options in the <smbconfsection name="[global]"/> section of the &smb.conf; file as shown
881 in <link linkend="xremmb">&smb.conf; for Not Being a master browser</link>
885 <example id="xremmb">
886 <title>&smb.conf; for Not Being a master browser</title>
887 <smbconfsection name="[global]"/>
888 <smbconfoption name="domain master">no</smbconfoption>
889 <smbconfoption name="local master">no</smbconfoption>
890 <smbconfoption name="preferred master">no</smbconfoption>
891 <smbconfoption name="os level">0</smbconfoption>
897 <sect2 id="browse-force-master">
898 <title>Forcing Samba to Be the Master</title>
901 <indexterm><primary>master browser</primary></indexterm>
902 <indexterm><primary>election process</primary></indexterm>
903 <indexterm><primary>broadcasts</primary></indexterm>
904 <indexterm><primary>election packet</primary></indexterm>
905 <indexterm><primary>bias</primary></indexterm>
906 <indexterm><primary>election</primary></indexterm>
907 <indexterm><primary>precedence</primary></indexterm>
908 Who becomes the master browser is determined by an election process using broadcasts. Each election packet
909 contains a number of parameters that determine what precedence (bias) a host should have in the election. By
910 default Samba uses a low precedence and thus loses elections to just about every Windows network server or
915 If you want Samba to win elections, set the <smbconfoption name="os level"/> global option in &smb.conf; to a
916 higher number. It defaults to 20. Using 34 would make it win all elections over every other system (except
917 other Samba systems).
921 An <smbconfoption name="os level"/> of two would make it beat Windows for Workgroups and Windows 9x/Me, but
922 not MS Windows NT/200x Server. An MS Windows NT/200x Server domain controller uses level 32. The maximum os
927 <indexterm><primary>force an election</primary></indexterm>
928 <indexterm><primary>potential master browsers</primary></indexterm>
929 <indexterm><primary>local subnet</primary></indexterm>
930 <indexterm><primary>LMB</primary></indexterm>
931 If you want Samba to force an election on startup, set the <smbconfoption name="preferred master"/> global
932 option in &smb.conf; to <constant>yes</constant>. Samba will then have a slight advantage over other
933 potential master browsers that are not preferred master browsers. Use this parameter with care, because if
934 you have two hosts (whether they are Windows 9x/Me or NT/200x/XP or Samba) on the same local subnet both set
935 with <smbconfoption name="preferred master"/> to <constant>yes</constant>, then periodically and continually
936 they will force an election in order to become the LMB.
940 <indexterm><primary>DMB</primary></indexterm>
941 <indexterm><primary>LAN</primary></indexterm>
942 <indexterm><primary>WAN</primary></indexterm>
943 <indexterm><primary>LMB</primary></indexterm>
944 <indexterm><primary>broadcast isolated subnet</primary></indexterm>
945 If you want Samba to be a <emphasis>DMB</emphasis>, then it is recommended that you also set <smbconfoption
946 name="preferred master"/> to <constant>yes</constant>, because Samba will not become a DMB for the whole of
947 your LAN or WAN if it is not also a LMB on its own broadcast isolated subnet.
951 <indexterm><primary>DMB</primary></indexterm>
952 <indexterm><primary>automatic redundancy</primary></indexterm>
953 <indexterm><primary>UDP</primary></indexterm>
954 <indexterm><primary>network bandwidth</primary></indexterm>
955 <indexterm><primary>browser elections</primary></indexterm>
956 It is possible to configure two Samba servers to attempt to become the DMB for a domain. The first server that
957 comes up will be the DMB. All other Samba servers will attempt to become the DMB every 5 minutes. They will
958 find that another Samba server is already the DMB and will fail. This provides automatic redundancy should the
959 current DMB fail. The network bandwidth overhead of browser elections is relatively small, requiring
960 approximately four UDP packets per machine per election. The maximum size of a UDP packet is 576 bytes.
966 <title>Making Samba the Domain Master</title>
969 <indexterm><primary>DMB</primary></indexterm>
970 <indexterm><primary>collating</primary></indexterm>
971 <indexterm><primary>browse lists</primary></indexterm>
972 <indexterm><primary>browsing</primary></indexterm>
973 The domain master browser is responsible for collating the browse lists of multiple subnets so browsing can
974 occur between subnets. You can make Samba act as the domain master browser by setting <smbconfoption name="domain
975 master">yes</smbconfoption> in &smb.conf;. By default it will not be a domain master browser.
979 <indexterm><primary>workgroup</primary></indexterm>
980 <indexterm><primary>network browsing problems</primary></indexterm>
981 Do not set Samba to be the domain master for a workgroup that has the same name as an NT/200x domain. If
982 Samba is configured to be the domain master for a workgroup that is present on the same network as a Windows
983 NT/200x domain that has the same name, network browsing problems will certainly be experienced.
987 When Samba is the domain master and the master browser, it will listen for master announcements (made roughly
988 every 12 minutes) from LMBs on other subnets and then contact them to synchronize browse lists.
992 <indexterm><primary>win election</primary></indexterm>
993 <indexterm><primary>force election</primary></indexterm>
994 If you want Samba to be the domain master, you should also set the <smbconfoption name="os level"/> high
995 enough to make sure it wins elections, and set <smbconfoption name="preferred master"/> to
996 <constant>yes</constant>, to get Samba to force an election on startup.
1000 <indexterm><primary>WINS server</primary></indexterm>
1001 <indexterm><primary>resolve NetBIOS names</primary></indexterm>
1002 All servers (including Samba) and clients should be using a WINS server to resolve NetBIOS names. If your
1003 clients are only using broadcasting to resolve NetBIOS names, then two things will occur:
1009 <indexterm><primary>LMB</primary></indexterm>
1010 <indexterm><primary>DMB</primary></indexterm>
1011 LMBs will be unable to find a DMB because they will be looking only on the local subnet.
1017 <indexterm><primary>domain-wide browse list</primary></indexterm>
1018 If a client happens to get hold of a domain-wide browse list and a user attempts to access a
1019 host in that list, it will be unable to resolve the NetBIOS name of that host.
1025 <indexterm><primary>WINS</primary></indexterm>
1026 If, however, both Samba and your clients are using a WINS server, then:
1032 LMBs will contact the WINS server and, as long as Samba has registered that it is a DMB with the WINS
1033 server, the LMB will receive Samba's IP address as its DMB.
1039 When a client receives a domain-wide browse list and a user attempts to access a host in that list, it will contact the WINS server to
1040 resolve the NetBIOS name of that host. As long as that host has registered its NetBIOS name with the same WINS server, the user will
1041 be able to see that host.
1049 <title>Note about Broadcast Addresses</title>
1052 <indexterm><primary>zero-based broadcast</primary></indexterm>
1053 If your network uses a zero-based broadcast address (for example, if it ends in a 0), then you will strike problems. Windows for Workgroups
1054 does not seem to support a zeros broadcast, and you will probably find that browsing and name lookups will not work.
1059 <title>Multiple Interfaces</title>
1062 <indexterm><primary>multiple network interfaces</primary></indexterm>
1063 Samba supports machines with multiple network interfaces. If you have multiple interfaces, you will
1064 need to use the <smbconfoption name="interfaces"/> option in &smb.conf; to configure them. For example, the
1065 machine you are working with has 4 network interfaces; <literal>eth0, eth1, eth2, eth3</literal> and only
1066 interfaces <literal>eth1</literal> and <literal>eth4</literal> should be used by Samba. In this case the
1067 following &smb.conf; file entries would permit that intent:
1069 <smbconfoption name="interfaces">eth1, eth4</smbconfoption>
1070 <smbconfoption name="bind interfaces only">Yes</smbconfoption>
1072 <indexterm><primary>port 135</primary></indexterm>
1073 <indexterm><primary>port 137</primary></indexterm>
1074 <indexterm><primary>port 138</primary></indexterm>
1075 <indexterm><primary>port 139</primary></indexterm>
1076 <indexterm><primary>port 445</primary></indexterm>
1077 <indexterm><primary>UDP</primary></indexterm>
1078 <indexterm><primary>TCP</primary></indexterm>
1079 The <smbconfoption name="bind interfaces only">Yes</smbconfoption> is necessary to exclude TCP/IP session
1080 services (ports 135, 139, and 445) over the interfaces that are not specified. Please be aware that
1081 <command>nmbd</command> will listen for incoming UDP port 137 packets on the unlisted interfaces, but it will
1082 not answer them. It will however send its broadcast packets over the unlisted interfaces. Total isolation of
1083 ethernet interface requires the use of a firewall to block ports 137 and 138 (UDP), and ports 135, 139, and
1084 445 (TCP) on all network interfaces that must not be able to access the Samba server.
1090 <title>Use of the Remote Announce Parameter</title>
1092 The <smbconfoption name="remote announce"/> parameter of
1093 &smb.conf; can be used to forcibly ensure
1094 that all the NetBIOS names on a network get announced to a remote network.
1095 The syntax of the <smbconfoption name="remote announce"/> parameter is:
1097 <smbconfoption name="remote announce">192.168.12.23 [172.16.21.255] ...</smbconfoption>
1099 <emphasis>or</emphasis>
1101 <smbconfoption name="remote announce">192.168.12.23/MIDEARTH [172.16.21.255/ELVINDORF] ...</smbconfoption>
1106 <varlistentry><term><replaceable>192.168.12.23</replaceable> and <replaceable>172.16.21.255</replaceable></term>
1108 <indexterm><primary>LMB</primary><see>Local Master Browser</see></indexterm>
1109 <indexterm><primary>Local Master Browser</primary></indexterm>
1110 is either the LMB IP address or the broadcast address of the remote network.
1111 That is, the LMB is at 192.168.1.23, or the address could be given as 172.16.21.255 where the netmask
1112 is assumed to be 24 bits (255.255.255.0). When the remote announcement is made to the broadcast
1113 address of the remote network, every host will receive our announcements. This is noisy and therefore
1114 undesirable but may be necessary if we do not know the IP address of the remote LMB.
1119 <term><replaceable>WORKGROUP</replaceable></term>
1120 <listitem><para>is optional and can be either our own workgroup or that of the remote network. If you use the
1121 workgroup name of the remote network, our NetBIOS machine names will end up looking like
1122 they belong to that workgroup. This may cause name resolution problems and should be avoided.
1131 <title>Use of the Remote Browse Sync Parameter</title>
1134 <indexterm><primary>LMB</primary></indexterm>
1135 <indexterm><primary>synchronize</primary></indexterm>
1136 The <smbconfoption name="remote browse sync"/> parameter of &smb.conf; is used to announce to another LMB that
1137 it must synchronize its NetBIOS name list with our Samba LMB. This works only if the Samba server that has
1138 this option is simultaneously the LMB on its network segment.
1142 The syntax of the <smbconfoption name="remote browse sync"/> parameter is:
1145 <smbconfoption name="remote browse sync"><replaceable>192.168.10.40</replaceable></smbconfoption>
1147 <indexterm><primary>LMB</primary></indexterm>
1148 <indexterm><primary>remote segment</primary></indexterm>
1149 where <replaceable>192.168.10.40</replaceable> is either the IP address of the
1150 remote LMB or the network broadcast address of the remote segment.
1158 <title>WINS: The Windows Internetworking Name Server</title>
1161 <indexterm><primary>WINS</primary></indexterm>
1162 <indexterm><primary>name_type</primary></indexterm>
1163 <indexterm><primary>LanManager-compatible</primary></indexterm>
1164 Use of WINS (either Samba WINS or MS Windows NT Server WINS) is highly
1165 recommended. Every NetBIOS machine registers its name together with a
1166 name_type value for each of several types of service it has available.
1167 It registers its name directly as a unique (the type 0x03) name.
1168 It also registers its name if it is running the LanManager-compatible
1169 server service (used to make shares and printers available to other users)
1170 by registering the server (the type 0x20) name.
1174 <indexterm><primary>NetBIOS name length</primary></indexterm>
1175 <indexterm><primary>name_type</primary></indexterm>
1176 All NetBIOS names are up to 15 characters in length. The name_type variable
1177 is added to the end of the name, thus creating a 16 character name. Any
1178 name that is shorter than 15 characters is padded with spaces to the 15th
1179 character. Thus, all NetBIOS names are 16 characters long (including the
1180 name_type information).
1184 <indexterm><primary>WINS</primary></indexterm>
1185 <indexterm><primary>registered</primary></indexterm>
1186 <indexterm><primary>NetLogon service</primary></indexterm>
1187 <indexterm><primary>lmhosts</primary></indexterm>
1188 WINS can store these 16-character names as they get registered. A client
1189 that wants to log onto the network can ask the WINS server for a list
1190 of all names that have registered the NetLogon service name_type. This saves
1191 broadcast traffic and greatly expedites logon processing. Since broadcast
1192 name resolution cannot be used across network segments, this type of
1193 information can only be provided via WINS or via a statically configured
1194 <filename>lmhosts</filename> file that must reside on all clients in the
1199 <indexterm><primary>synchronization</primary></indexterm>
1200 <indexterm><primary>LMB</primary></indexterm>
1201 <indexterm><primary>DMB</primary></indexterm>
1202 <indexterm><primary>WINS</primary></indexterm>
1203 <indexterm><primary>browse list</primary></indexterm>
1204 WINS also forces browse list synchronization by all LMBs. LMBs must synchronize their browse list with the
1205 DMB, and WINS helps the LMB to identify its DMB. By definition this will work only within a single workgroup.
1206 Note that the DMB has nothing to do with what is referred to as an MS Windows NT domain. The latter is a
1207 reference to a security environment, while the DMB refers to the master controller for browse list information
1212 <indexterm><primary>WINS</primary></indexterm>
1213 <indexterm><primary>TCP/IP protocol stack</primary></indexterm>
1214 <indexterm><primary>WINS servers</primary></indexterm>
1215 <indexterm><primary>name-to-address</primary></indexterm>
1216 WINS will work correctly only if every client TCP/IP protocol stack
1217 is configured to use the WINS servers. Any client that is not
1218 configured to use the WINS server will continue to use only broadcast-based
1219 name registration, so WINS may never get to know about it. In any case,
1220 machines that have not registered with a WINS server will fail name-to-address
1221 lookup attempts by other clients and will therefore cause workstation access
1226 To configure Samba as a WINS server, just add
1227 <smbconfoption name="wins support">yes</smbconfoption> to the &smb.conf;
1228 file [global] section.
1232 To configure Samba to register with a WINS server, just add <smbconfoption name="wins
1233 server">10.0.0.18</smbconfoption> to your &smb.conf; file <smbconfsection name="[global]"/> section.
1237 Never use <smbconfoption name="wins support">yes</smbconfoption> together with <smbconfoption name="wins
1238 server">10.0.0.18</smbconfoption> particularly not using its own IP address. Specifying both will cause &nmbd;
1243 <title>WINS Server Configuration</title>
1246 <indexterm><primary>WINS</primary></indexterm>
1247 Either a Samba server or a Windows NT server machine may be set up
1248 as a WINS server. To configure a Samba server to be a WINS server, you must
1249 add to the &smb.conf; file on the selected Server the following line to
1250 the <smbconfsection name="[global]"/> section:
1255 <smbconfoption name="wins support">yes</smbconfoption>
1260 <indexterm><primary>Samba 1.9.17</primary></indexterm>
1261 Versions of Samba prior to 1.9.17 had this parameter default to
1262 yes. If you have any older versions of Samba on your network, it is
1263 strongly suggested you upgrade to a recent version, or at the very
1264 least set the parameter to <quote>no</quote> on all these machines.
1268 Machines configured with <smbconfoption name="wins support">yes</smbconfoption> will keep a list of
1269 all NetBIOS names registered with them, acting as a DNS for NetBIOS names.
1273 <indexterm><primary>only one WINS server</primary></indexterm>
1274 It is strongly recommended to set up only one WINS server. Do not set the
1275 <smbconfoption name="wins support">yes</smbconfoption> option on more than one Samba
1276 server on a network.
1280 <indexterm><primary>replication</primary><secondary>WINS</secondary></indexterm>
1281 <indexterm><primary>Windows NT/200x</primary></indexterm>
1282 <indexterm><primary>WINS service</primary></indexterm>
1283 <indexterm><primary>replication protocols</primary></indexterm>
1284 <indexterm><primary>WINS server</primary></indexterm>
1285 To configure Windows NT/200x Server as a WINS server, install and configure the WINS service. See the Windows
1286 NT/200x documentation for details. Windows NT/200x WINS servers can replicate to each other, allowing more
1287 than one to be set up in a complex subnet environment. Because Microsoft refuses to document the replication
1288 protocols, Samba cannot currently participate in these replications. It is possible in the future that a
1289 Samba-to-Samba WINS replication protocol may be defined, in which case more than one Samba machine could be
1290 set up as a WINS server. Currently only one Samba server should have the <smbconfoption name="wins
1291 support">yes</smbconfoption> parameter set.
1295 <indexterm><primary>WINS server</primary></indexterm>
1296 <indexterm><primary>Primary WINS Server</primary></indexterm>
1297 After the WINS server has been configured, you must ensure that all machines participating on the network are
1298 configured with the address of this WINS server. If your WINS server is a Samba machine, fill in the Samba
1299 machine IP address in the <guilabel>Primary WINS Server</guilabel> field of the <guilabel>Control
1300 Panel->Network->Protocols->TCP->WINS Server</guilabel> dialogs in Windows 9x/Me or Windows NT/200x. To tell a
1301 Samba server the IP address of the WINS server, add the following line to the <smbconfsection
1302 name="[global]"/> section of all &smb.conf; files:
1304 <smbconfoption name="wins server"><name or IP address></smbconfoption>
1306 where <name or IP address> is either the DNS name of the WINS server
1307 machine or its IP address.
1311 This line must not be set in the &smb.conf; file of the Samba
1312 server acting as the WINS server itself. If you set both the
1313 <smbconfoption name="wins support">yes</smbconfoption> option and the
1314 <smbconfoption name="wins server"><name></smbconfoption> option then
1315 <command>nmbd</command> will fail to start.
1319 <indexterm><primary>cross-subnet browsing</primary></indexterm>
1320 <indexterm><primary>Windows 9x/Me</primary></indexterm>
1321 <indexterm><primary>Windows NT/200x</primary></indexterm>
1322 <indexterm><primary>not part of domain</primary></indexterm>
1323 There are two possible scenarios for setting up cross-subnet browsing.
1324 The first details setting up cross-subnet browsing on a network containing
1325 Windows 9x/Me, Samba, and Windows NT/200x machines that are not configured as
1326 part of a Windows NT domain. The second details setting up cross-subnet
1327 browsing on networks that contain NT domains.
1333 <title>WINS Replication</title>
1336 <indexterm><primary>replication</primary><secondary>WINS</secondary></indexterm>
1337 <indexterm><primary>WINS replication</primary></indexterm>
1338 Samba-3 permits WINS replication through the use of the <filename>wrepld</filename> utility. This tool is not
1339 currently in use because it is still in development and has not been worked on for a long time. As soon as
1340 this tool becomes moderately functional, we will prepare man pages and enhance this section of the
1341 documentation to provide usage and technical details.
1346 <title>Static WINS Entries</title>
1349 <indexterm><primary>static WINS entries</primary></indexterm>
1350 <indexterm><primary>wins.dat</primary></indexterm>
1351 <indexterm><primary>/usr/local/samba/var/locks</primary></indexterm>
1352 <indexterm><primary>/var/run/samba</primary></indexterm>
1353 Adding static entries to your Samba WINS server is actually fairly easy. All you have to do is add a line to
1354 <filename>wins.dat</filename>, typically located in <filename
1355 class="directory">/usr/local/samba/var/locks</filename> or <filename>/var/run/samba</filename>.
1359 Entries in <filename>wins.dat</filename> take the form of:
1361 "NAME#TYPE" TTL ADDRESS+ FLAGS
1363 <indexterm><primary>TTL</primary></indexterm>
1364 <indexterm><primary>time-to-live</primary><see>TTL</see></indexterm>
1365 where NAME is the NetBIOS name, TYPE is the NetBIOS type, TTL is the time-to-live as an absolute time in
1366 seconds, ADDRESS+ is one or more addresses corresponding to the registration, and FLAGS are the NetBIOS flags
1367 for the registration.
1371 A typical dynamic entry looks like this:
1373 "MADMAN#03" 1155298378 192.168.1.2 66R
1375 To make a NetBIOS name static (permanent), simply set the TTL to 0, like this:
1377 "MADMAN#03" 0 192.168.1.2 66R
1382 <indexterm><primary>NetBIOS flags</primary></indexterm>
1383 <indexterm><primary>Broadcast node</primary></indexterm>
1384 <indexterm><primary>Peer node</primary></indexterm>
1385 <indexterm><primary>Meta node</primary></indexterm>
1386 <indexterm><primary>Hybrid node</primary></indexterm>
1387 <indexterm><primary>Permanent name</primary></indexterm>
1388 <indexterm><primary>nameserv.h</primary></indexterm>
1389 The NetBIOS flags may be interpreted as additive hexadecimal values: 00 - Broadcast node registration, 20 -
1390 Peer node registration, 40 - Meta node registration, 60 - Hybrid node registration, 02 - Permanent name, 04 -
1391 Active name, 80 - Group name. The 'R' indications this is a registration record. Thus 66R means: Hyrbid node
1392 active and permanent NetBIOS name. These values may be found in the <filename>nameserv.h</filename> header
1393 file from the Samba source code repository. These are the values for the NB flags.
1397 <indexterm><primary>WINS replication</primary></indexterm>
1398 Though this method works with early Samba-3 versions, there is a possibility that it may change in future
1399 versions if WINS replication is added.
1406 <title>Helpful Hints</title>
1409 The following hints should be carefully considered because they are stumbling points
1410 for many new network administrators.
1414 <title>Windows Networking Protocols</title>
1417 <indexterm><primary>browsing problems</primary></indexterm>
1418 <indexterm><primary>more than one protocol</primary></indexterm>
1419 A common cause of browsing problems results from the installation of more than one protocol on an MS Windows
1424 Do not use more than one protocol on MS Windows clients.
1428 <indexterm><primary>LMB</primary></indexterm>
1429 <indexterm><primary>DMB</primary></indexterm>
1430 Every NetBIOS machine takes part in a process of electing the LMB (and DMB)
1431 every 15 minutes. A set of election criteria is used to determine the order
1432 of precedence for winning this election process. A machine running Samba or
1433 Windows NT will be biased, so the most suitable machine will predictably
1434 win and thus retain its role.
1438 <indexterm><primary>NetBIOS network interface</primary></indexterm>
1439 <indexterm><primary>TCP/IP</primary></indexterm>
1440 <indexterm><primary>IPX</primary></indexterm>
1441 <indexterm><primary>LMB</primary></indexterm>
1442 <indexterm><primary>Windows 9x/Me</primary></indexterm>
1443 <indexterm><primary>TCP/IP-only</primary></indexterm>
1444 The election process is <emphasis>fought out, so to speak</emphasis> over every NetBIOS network interface. In
1445 the case of a Windows 9x/Me machine that has both TCP/IP and IPX installed and has NetBIOS enabled over both
1446 protocols, the election will be decided over both protocols. As often happens, if the Windows 9x/Me machine is
1447 the only one with both protocols, then the LMB may be won on the NetBIOS interface over the IPX protocol.
1448 Samba will then lose the LMB role because Windows 9x/Me will insist it knows who the LMB is. Samba will then
1449 cease to function as an LMB, and browse list operation on all TCP/IP-only machines will therefore fail.
1453 <indexterm><primary>Windows 9x/Me</primary></indexterm>
1454 <indexterm><primary>extended protocol</primary></indexterm>
1455 Windows 95, 98, 98se, and Me are referred to generically as Windows 9x/Me.
1456 The Windows NT4, 200x, and XP use common protocols. These are roughly
1457 referred to as the Windows NT family, but it should be recognized that 2000 and
1458 XP/2003 introduce new protocol extensions that cause them to behave
1459 differently from MS Windows NT4. Generally, where a server does not support
1460 the newer or extended protocol, these will fall back to the NT4 protocols.
1464 The safest rule of all to follow is: Use only one protocol!
1470 <title>Name Resolution Order</title>
1473 <indexterm><primary>NetBIOS names</primary></indexterm>
1474 <indexterm><primary>name_type</primary></indexterm>
1475 Resolution of NetBIOS names to IP addresses can take place using a number
1476 of methods. The only ones that can provide NetBIOS name_type information
1481 <listitem><para>WINS &smbmdash; the best tool.</para></listitem>
1482 <listitem><para>LMHOSTS &smbmdash; static and hard to maintain.</para></listitem>
1483 <listitem><para>Broadcast &smbmdash; uses UDP and cannot resolve names across remote segments.</para></listitem>
1487 Alternative means of name resolution include:
1490 <listitem><para>Static <filename>/etc/hosts</filename> &smbmdash; hard to maintain and lacks name_type info.</para></listitem>
1491 <listitem><para>DNS &smbmdash; is a good choice but lacks essential NetBIOS name_type information.</para></listitem>
1495 <indexterm><primary>restrict DNS</primary></indexterm>
1496 <indexterm><primary>name resolve order</primary></indexterm>
1497 Many sites want to restrict DNS lookups and avoid broadcast name
1498 resolution traffic. The <parameter>name resolve order</parameter> parameter is of great help here.
1499 The syntax of the <parameter>name resolve order</parameter> parameter is:
1501 <smbconfoption name="name resolve order">wins lmhosts bcast host</smbconfoption>
1503 <emphasis>or</emphasis>
1505 <smbconfoption name="name resolve order">wins lmhosts (eliminates bcast and host)</smbconfoption>
1509 <smbconfoption name="name resolve order">host lmhost wins bcast</smbconfoption>,
1511 <indexterm><primary>gethostbyname() function call</primary></indexterm>
1512 where <quote>host</quote> refers to the native methods used by the UNIX system
1513 to implement the gethostbyname() function call. This is normally
1514 controlled by <filename>/etc/host.conf</filename>, <filename>/etc/nsswitch.conf</filename> and <filename>/etc/resolv.conf</filename>.
1520 <title>Technical Overview of Browsing</title>
1523 <indexterm><primary>SMB</primary></indexterm>
1524 SMB networking provides a mechanism by which clients can access a list
1525 of machines in a network called <smbconfoption name="browse list"/>. This list
1526 contains machines that are ready to offer file and/or print services
1527 to other machines within the network. It therefore does not include
1528 machines that aren't currently able to do server tasks. The browse
1529 list is heavily used by all SMB clients. Configuration of SMB
1530 browsing has been problematic for some Samba users, hence this
1535 <indexterm><primary>NetBIOS over TCP/IP</primary></indexterm>
1536 <indexterm><primary>DNS/LDAP/ADS</primary></indexterm>
1537 <indexterm><primary>name resolution</primary></indexterm>
1538 MS Windows 2000 and later versions, as with Samba-3 and later versions, can be
1539 configured to not use NetBIOS over TCP/IP. When configured this way,
1540 it is imperative that name resolution (using DNS/LDAP/ADS) be correctly
1541 configured and operative. Browsing will not work if name resolution
1542 from SMB machine names to IP addresses does not function correctly.
1546 <indexterm><primary>NetBIOS</primary></indexterm>
1547 <indexterm><primary>WINS</primary></indexterm>
1548 Where NetBIOS over TCP/IP is enabled, use of a WINS server is highly
1549 recommended to aid the resolution of NetBIOS (SMB) names to IP addresses.
1550 WINS allows remote segment clients to obtain NetBIOS name_type information
1551 that cannot be provided by any other means of name resolution.
1555 <title>Browsing Support in Samba</title>
1558 <indexterm><primary>browsing</primary></indexterm>
1559 <indexterm><primary>LMB</primary></indexterm>
1560 <indexterm><primary>domain logons</primary></indexterm>
1561 <indexterm><primary>scripts</primary></indexterm>
1562 Samba facilitates browsing. The browsing is supported by &nmbd;
1563 and is also controlled by options in the &smb.conf; file.
1564 Samba can act as an LMB for a workgroup, and the ability
1565 to support domain logons and scripts is now available.
1569 <indexterm><primary>DMB for a workgroup</primary></indexterm>
1570 <indexterm><primary>LMB</primary></indexterm>
1571 <indexterm><primary>WINS</primary></indexterm>
1572 Samba can also act as a DMB for a workgroup. This
1573 means that it will collate lists from LMBs into a
1574 wide-area network server list. In order for browse clients to
1575 resolve the names they may find in this list, it is recommended that
1576 both Samba and your clients use a WINS server.
1580 <indexterm><primary>domain master</primary></indexterm>
1581 Do not set Samba to be the domain master for a workgroup that has the same
1582 name as an NT Domain. On each wide-area network, you must only ever have one
1583 DMB per workgroup, regardless of whether it is NT, Samba,
1584 or any other type of domain master that is providing this service.
1588 <indexterm><primary>nmbd</primary></indexterm>
1589 <indexterm><primary>WINS server</primary></indexterm>
1590 <command>nmbd</command> can be configured as a WINS server, but it is not
1591 necessary to specifically use Samba as your WINS server. MS Windows
1592 NT4, Server or Advanced Server 200x can be configured as
1593 your WINS server. In a mixed NT/200x server and Samba environment on
1594 a WAN, it is recommended that you use the Microsoft
1595 WINS server capabilities. In a Samba-only environment, it is
1596 recommended that you use one and only one Samba server as the WINS server.
1600 <indexterm><primary>nmbd</primary></indexterm>
1601 To get browsing to work, you need to run <command>nmbd</command> as usual, but must
1602 use the <smbconfoption name="workgroup"/> option in &smb.conf;
1603 to control what workgroup Samba becomes a part of.
1607 <indexterm><primary>browsing another subnet</primary></indexterm>
1608 Samba also has a useful option for a Samba server to offer itself for
1609 browsing on another subnet. It is recommended that this option is
1610 used only for <quote>unusual</quote> purposes: announcements over the Internet, for
1611 example. See <smbconfoption name="remote announce"/> in the
1612 &smb.conf; man page.
1617 <title>Problem Resolution</title>
1620 <indexterm><primary>log.nmbd</primary></indexterm>
1621 <indexterm><primary>browse.dat</primary></indexterm>
1622 If something does not work, the <filename>log.nmbd</filename> file will help
1623 to track down the problem. Try a <smbconfoption name="log level"></smbconfoption> of 2 or 3 for finding
1624 problems. Also note that the current browse list usually gets stored
1625 in text form in a file called <filename>browse.dat</filename>.
1629 <indexterm><primary>\\SERVER</primary></indexterm>
1630 <indexterm><primary>filemanager</primary></indexterm>
1631 If it does not work, you should still be able to
1632 type the server name as <filename>\\SERVER</filename> in <command>filemanager</command>, then
1633 press enter, and <command>filemanager</command> should display the list of available shares.
1637 <indexterm><primary>IPC$</primary></indexterm>
1638 <indexterm><primary>guest account</primary></indexterm>
1639 Some people find browsing fails because they do not have the global
1640 <smbconfoption name="guest account"/> set to a valid account. Remember that the
1641 IPC$ connection that lists the shares is done as guest and so you must have a valid guest account.
1645 <indexterm><primary>IPC$</primary></indexterm>
1646 <indexterm><primary>Windows Explorer</primary></indexterm>
1647 <indexterm><primary>browse resources</primary></indexterm>
1648 <indexterm><primary>Network Neighborhood</primary></indexterm>
1649 <indexterm><primary>My Network Places</primary></indexterm>
1650 The <literal>IPC$</literal> share is used by all SMB/CIFS clients to obtain the list of resources
1651 that is available on the server. This is the source of the list of shares and printers when browsing
1652 an SMB/CIFS server (also Windows machines) using the Windows Explorer to browse resources through
1653 the Windows Network Neighborhood (also called My Network Places) through to a Windows server. At
1654 this point the client has opened a connection to the <literal>\\server\IPC4</literal> resource.
1655 Clicking on a share will then open up a connection to the <literal>\\server\share</literal>.
1659 <indexterm><primary>guest account</primary></indexterm>
1660 <indexterm><primary>anonymous access</primary></indexterm>
1661 <indexterm><primary>IPC$</primary></indexterm>
1662 <indexterm><primary>browse server resources</primary></indexterm>
1663 MS Windows 2000 and later (as with Samba) can be configured to disallow
1664 anonymous (i.e., guest account) access to the IPC$ share. In that case, the
1665 MS Windows 2000/XP/2003 machine acting as an SMB/CIFS client will use the
1666 name of the currently logged-in user to query the IPC$ share. MS Windows
1667 9x/Me clients are not able to do this and thus will not be able to browse
1672 <indexterm><primary>broadcast address</primary></indexterm>
1673 The other big problem people have is that their broadcast address,
1674 netmask, or IP address is wrong (specified with the <smbconfoption name="interfaces"></smbconfoption> option
1680 <title>Cross-Subnet Browsing</title>
1683 <indexterm><primary>replication</primary><secondary>browse lists</secondary></indexterm>
1684 <indexterm><primary>browse across subnet</primary></indexterm>
1685 Since the release of Samba 1.9.17 (alpha1), Samba has supported the replication of browse lists across subnet
1686 boundaries. This section describes how to set this feature up in different settings.
1690 <indexterm><primary>browse lists</primary></indexterm>
1691 <indexterm><primary>broadcast traffic</primary></indexterm>
1692 <indexterm><primary>UDP</primary></indexterm>
1693 <indexterm><primary>WINS</primary></indexterm>
1694 <indexterm><primary>remote announce</primary></indexterm>
1695 <indexterm><primary>remote browse sync</primary></indexterm>
1696 To see browse lists that span TCP/IP subnets (i.e., networks separated by routers that do not pass broadcast
1697 traffic), you must set up at least one WINS server. The WINS server acts as a DNS for NetBIOS names. This will
1698 allow NetBIOS name-to-IP address translation to be completed by a direct query of the WINS server. This is
1699 done via a directed UDP packet on port 137 to the WINS server machine. The WINS server avoids the necessity of
1700 default NetBIOS name-to-IP address translation, which is done using UDP broadcasts from the querying machine.
1701 This means that machines on one subnet will not be able to resolve the names of machines on another subnet
1702 without using a WINS server. The Samba hacks, <parameter>remote browse sync</parameter>, and <parameter>remote
1703 announce</parameter> are designed to get around the natural limitations that provent UDP broadcast
1704 propagation. The hacks are not a universal solution and they should not be used in place of WINS, they are
1705 considered last resort methods.
1709 <indexterm><primary>DHCP</primary></indexterm>
1710 <indexterm><primary>browsing across subnets</primary></indexterm>
1711 <indexterm><primary>WINS</primary></indexterm>
1712 <indexterm><primary>Network settings</primary></indexterm>
1713 Remember, for browsing across subnets to work correctly, all machines, be they Windows 95, Windows NT, or
1714 Samba servers, must have the IP address of a WINS server given to them by a DHCP server or by manual
1715 configuration: for Windows 9x/Me and Windows NT/200x/XP, this is in the TCP/IP Properties, under Network
1716 settings; for Samba, this is in the &smb.conf; file.
1720 <indexterm><primary>NetBIOS over TCP/IP</primary></indexterm>
1721 <indexterm><primary>ADS</primary></indexterm>
1722 <indexterm><primary>DNS</primary></indexterm>
1723 It is possible to operate Samba-3 without NetBIOS over TCP/IP. If you do this, be warned that if used outside
1724 of MS ADS, this will forgo network browsing support. ADS permits network browsing support through DNS,
1725 providing appropriate DNS records are inserted for all Samba servers.
1729 <title>Behavior of Cross-Subnet Browsing</title>
1732 <indexterm><primary>cross-subnet browsing</primary></indexterm>
1733 <indexterm><primary>complicated</primary></indexterm>
1734 Cross-subnet browsing is a complicated dance, containing multiple moving parts. It has taken Microsoft several
1735 years to get the code that correctly achieves this, and Samba lags behind in some areas. Samba is capable of
1736 cross-subnet browsing when configured correctly.
1740 Consider a network set up as in <link linkend="browsing1">Cross-Subnet Browsing Example</link>.
1743 <figure id="browsing1">
1744 <title>Cross-Subnet Browsing Example.</title>
1745 <imagefile scale="40">browsing1</imagefile>
1749 <indexterm><primary>broadcasts</primary></indexterm>
1750 <indexterm><primary>DMB</primary></indexterm>
1751 <indexterm><primary>WINS</primary></indexterm>
1752 This consists of three subnets (1, 2, 3) connected by two routers (R1, R2), which do not pass broadcasts.
1753 Subnet 1 has five machines on it, subnet 2 has four machines, and subnet 3 has four machines. Assume for the
1754 moment that all machines are configured to be in the same workgroup (for simplicity's sake). Machine N1_C on
1755 subnet 1 is configured as the DMB (i.e., it will collate the browse lists for the workgroup). Machine N2_D is
1756 configured as a WINS server, and all the other machines are configured to register their NetBIOS names with
1761 <indexterm><primary>master browsers</primary></indexterm>
1762 <indexterm><primary>LMB</primary></indexterm>
1763 <indexterm><primary>DMB</primary></indexterm>
1764 As these machines are booted up, elections for master browsers
1765 take place on each of the three subnets. Assume that machine
1766 N1_C wins on subnet 1, N2_B wins on subnet 2, and N3_D wins on
1767 subnet 3. These machines are known as LMBs for
1768 their particular subnet. N1_C has an advantage in winning as the
1769 LMB on subnet 1 because it is set up as DMB.
1773 <indexterm><primary>LMB</primary></indexterm>
1774 <indexterm><primary>browse list</primary></indexterm>
1775 On each of the three networks, machines that are configured to
1776 offer sharing services will broadcast that they are offering
1777 these services. The LMB on each subnet will
1778 receive these broadcasts and keep a record of the fact that
1779 the machine is offering a service. This list of records is
1780 the basis of the browse list. For this case, assume that
1781 all the machines are configured to offer services, so all machines
1782 will be on the browse list.
1786 <indexterm><primary>LMB</primary></indexterm>
1787 <indexterm><primary>authoritative</primary></indexterm>
1788 <indexterm><primary>verifiable</primary></indexterm>
1789 <indexterm><primary>trusted</primary></indexterm>
1790 <indexterm><primary>non-authoritative</primary></indexterm>
1791 For each network, the LMB on that network is
1792 considered <emphasis>authoritative</emphasis> for all the names it receives via
1793 local broadcast. This is because a machine seen by the LMB
1794 via a local broadcast must be on the same network as the
1795 Local Master Browser and thus is a <emphasis>trusted</emphasis>
1796 and <emphasis>verifiable</emphasis> resource. Machines on other networks that
1797 the LMBs learn about when collating their
1798 browse lists have not been directly seen. These records are
1799 called <emphasis>non-authoritative.</emphasis>
1803 <indexterm><primary>network neighborhood</primary></indexterm>
1804 At this point the browse lists appear as shown in <link linkend="browsubnet">Browse Subnet Example 1</link> (these are
1805 the machines you would see in your network neighborhood if you looked in it on a particular network right now).
1809 <table frame="all" id="browsubnet">
1810 <title>Browse Subnet Example 1</title>
1811 <tgroup align="left" cols="3">
1813 <row><entry>Subnet</entry><entry>Browse Master</entry><entry>List</entry></row>
1817 <row><entry>Subnet1</entry><entry>N1_C</entry><entry>N1_A, N1_B, N1_C, N1_D, N1_E</entry></row>
1818 <row><entry>Subnet2</entry><entry>N2_B</entry><entry>N2_A, N2_B, N2_C, N2_D</entry></row>
1819 <row><entry>Subnet3</entry><entry>N3_D</entry><entry>N3_A, N3_B, N3_C, N3_D</entry></row>
1826 At this point all the subnets are separate, and no machine is seen across any of the subnets.
1830 <indexterm><primary>DMB</primary></indexterm>
1831 <indexterm><primary>LMB</primary></indexterm>
1832 <indexterm><primary>synchronize</primary></indexterm>
1833 <indexterm><primary>WINS</primary></indexterm>
1834 Now examine subnet 2 in <link linkend="brsbex">Browse Subnet Example 2</link>.
1835 As soon as N2_B has become the LMB, it looks for a DMB with which to synchronize
1836 its browse list. It does this by querying the WINS server
1837 (N2_D) for the IP address associated with the NetBIOS name
1838 WORKGROUP<1B>. This name was registered by the DMB
1839 (N1_C) with the WINS server as soon as it was started.
1843 <indexterm><primary>MasterAnnouncement</primary></indexterm>
1844 <indexterm><primary>NetServerEnum2</primary></indexterm>
1845 <indexterm><primary>synchronization</primary></indexterm>
1846 <indexterm><primary>browse lists</primary></indexterm>
1847 Once N2_B knows the address of the DMB, it
1848 tells it that is the LMB for subnet 2 by
1849 sending a <emphasis>MasterAnnouncement</emphasis> packet as a UDP port 138 packet.
1850 It then synchronizes with it by doing a <emphasis>NetServerEnum2</emphasis> call. This
1851 tells the DMB to send it all the server
1852 names it knows about. Once the DMB receives
1853 the <emphasis>MasterAnnouncement</emphasis> packet, it schedules a synchronization
1854 request to the sender of that packet. After both synchronizations
1855 are complete, the browse lists look like those in <link linkend="brsbex">Browse Subnet Example 2</link>
1858 <table frame="all" id="brsbex">
1859 <title>Browse Subnet Example 2</title>
1861 <colspec align="left"/>
1862 <colspec align="left"/>
1863 <colspec align="justify" colwidth="1*"/>
1865 <row><entry>Subnet</entry><entry>Browse Master</entry><entry>List</entry></row>
1869 <row><entry>Subnet1</entry><entry>N1_C</entry><entry>N1_A, N1_B, N1_C, N1_D, N1_E,
1870 N2_A(*), N2_B(*), N2_C(*), N2_D(*)</entry></row>
1871 <row><entry>Subnet2</entry><entry>N2_B</entry><entry>N2_A, N2_B, N2_C, N2_D, N1_A(*),
1872 N1_B(*), N1_C(*), N1_D(*), N1_E(*)</entry></row>
1873 <row><entry>Subnet3</entry><entry>N3_D</entry><entry>N3_A, N3_B, N3_C, N3_D</entry></row>
1879 <indexterm><primary>non-authoritative</primary></indexterm>
1880 Servers with an (*) after them are non-authoritative names.
1884 <indexterm><primary>Network Neighborhood</primary></indexterm>
1885 At this point users looking in their Network Neighborhood on
1886 subnets 1 or 2 will see all the servers on both; users on
1887 subnet 3 will still see only the servers on their own subnet.
1891 <indexterm><primary>DMB</primary></indexterm>
1892 The same sequence of events that occurred for N2_B now occurs
1893 for the LMB on subnet 3 (N3_D). When it
1894 synchronizes browse lists with the DMB (N1_A)
1895 it gets both the server entries on subnet 1 and those on
1896 subnet 2. After N3_D has synchronized with N1_C and vica versa,
1897 the browse lists will appear as shown in <link linkend="brsex2">Browse Subnet Example 3</link>
1900 <table frame="all" id="brsex2">
1901 <title>Browse Subnet Example 3</title>
1902 <tgroup cols="3" align="left">
1903 <colspec align="left"/>
1904 <colspec align="left"/>
1905 <colspec align="justify" colwidth="1*"/>
1908 <row><entry>Subnet</entry><entry>Browse Master</entry><entry>List</entry></row>
1912 <row><entry>Subnet1</entry><entry>N1_C</entry><entry>N1_A, N1_B, N1_C, N1_D, N1_E,
1913 N2_A(*), N2_B(*), N2_C(*), N2_D(*), N3_A(*), N3_B(*), N3_C(*), N3_D(*)</entry></row>
1914 <row><entry>Subnet2</entry><entry>N2_B</entry><entry>N2_A, N2_B, N2_C, N2_D, N1_A(*),
1915 N1_B(*), N1_C(*), N1_D(*), N1_E(*)</entry></row>
1916 <row><entry>Subnet3</entry><entry>N3_D</entry><entry>N3_A, N3_B, N3_C, N3_D, N1_A(*),
1917 N1_B(*), N1_C(*), N1_D(*), N1_E(*), N2_A(*), N2_B(*), N2_C(*), N2_D(*)</entry></row>
1923 Servers with an (*) after them are non-authoritative names.
1927 At this point, users looking in their Network Neighborhood on
1928 subnets 1 or 3 will see all the servers on all subnets, while users on
1929 subnet 2 will still see only the servers on subnets 1 and 2, but not 3.
1933 <indexterm><primary>LMB</primary></indexterm>
1934 <indexterm><primary>DMB</primary></indexterm>
1935 <indexterm><primary>browse lists</primary></indexterm>
1936 Finally, the LMB for subnet 2 (N2_B) will sync again
1937 with the DMB (N1_C) and will receive the missing
1938 server entries. Finally, as when a steady state (if no machines
1939 are removed or shut off) has been achieved, the browse lists will appear
1940 as shown in <link linkend="brsex3">Browse Subnet Example 4</link>.
1943 <table frame="all" id="brsex3">
1944 <title>Browse Subnet Example 4</title>
1945 <tgroup cols="3" align="left">
1946 <colspec align="left"/>
1947 <colspec align="left"/>
1948 <colspec align="justify" colwidth="1*"/>
1951 <row><entry>Subnet</entry><entry>Browse Master</entry><entry>List</entry></row>
1955 <row><entry>Subnet1</entry><entry>N1_C</entry><entry>N1_A, N1_B, N1_C, N1_D, N1_E,
1956 N2_A(*), N2_B(*), N2_C(*), N2_D(*), N3_A(*), N3_B(*),
1957 N3_C(*), N3_D(*)</entry></row>
1958 <row><entry>Subnet2</entry><entry>N2_B</entry><entry>N2_A, N2_B, N2_C, N2_D, N1_A(*),
1959 N1_B(*), N1_C(*), N1_D(*), N1_E(*), N3_A(*), N3_B(*),
1960 N3_C(*), N3_D(*)</entry></row>
1961 <row><entry>Subnet3</entry><entry>N3_D</entry><entry>N3_A, N3_B, N3_C, N3_D, N1_A(*),
1962 N1_B(*), N1_C(*), N1_D(*), N1_E(*), N2_A(*), N2_B(*),
1963 N2_C(*), N2_D(*)</entry></row>
1969 Servers with an (*) after them are non-authoritative names.
1973 Synchronizations between the DMB and LMBs
1974 will continue to occur, but this should remain a
1975 steady-state operation.
1979 If either router R1 or R2 fails, the following will occur:
1985 <indexterm><primary>Network Neighborhood</primary></indexterm>
1986 Names of computers on each side of the inaccessible network fragments
1987 will be maintained for as long as 36 minutes in the Network Neighborhood
1994 Attempts to connect to these inaccessible computers will fail, but the
1995 names will not be removed from the Network Neighborhood lists.
2001 <indexterm><primary>WINS</primary></indexterm>
2002 <indexterm><primary>NetBIOS name resolution</primary></indexterm>
2003 <indexterm><primary>DNS server</primary></indexterm>
2004 If one of the fragments is cut off from the WINS server, it will only
2005 be able to access servers on its local subnet using subnet-isolated
2006 broadcast NetBIOS name resolution. The effect is similar to that of
2007 losing access to a DNS server.
2016 <title>Common Errors</title>
2019 <indexterm><primary>browsing problems</primary></indexterm>
2020 <indexterm><primary>name resolution</primary></indexterm>
2021 Many questions are asked on the mailing lists regarding browsing. The majority of browsing
2022 problems originate from incorrect configuration of NetBIOS name resolution. Some are of
2027 <title>Flushing the Samba NetBIOS Name Cache</title>
2030 How Can One Flush the Samba NetBIOS Name Cache without Restarting Samba?
2034 <indexterm><primary>flush name cache</primary></indexterm>
2035 <indexterm><primary>nmbd</primary></indexterm>
2036 <indexterm><primary>NetBIOS name cache</primary></indexterm>
2037 <indexterm><primary>rogue machine</primary></indexterm>
2038 Samba's <command>nmbd</command> process controls all browse list handling. Under normal circumstances it is
2039 safe to restart <command>nmbd</command>. This will effectively flush the Samba NetBIOS name cache and cause it
2040 to be rebuilt. This does not make certain that a rogue machine name will not reappear
2041 in the browse list. When <command>nmbd</command> is taken out of service, another machine on the network will
2042 become the browse master. This new list may still have the rogue entry in it. If you really
2043 want to clear a rogue machine from the list, every machine on the network must be
2044 shut down and restarted after all machines are down. Failing a complete restart, the only
2045 other thing you can do is wait until the entry times out and is then flushed from the list.
2046 This may take a long time on some networks (perhaps months).
2052 <title>Server Resources Cannot Be Listed</title>
2054 <para><quote>My Client Reports "<quote>This server is not configured to list shared resources."</quote></quote></para>
2058 Your guest account is probably invalid for some reason. Samba uses the
2059 guest account for browsing in <command>smbd</command>. Check that your guest account is
2063 <para>Also see <smbconfoption name="guest account"/> in the &smb.conf; man page.</para>
2068 <title>I Get an "<errorname>Unable to browse the network</errorname>" Error</title>
2070 <para>This error can have multiple causes:
2071 <indexterm><primary>browsing problems</primary></indexterm>
2075 <listitem><para>There is no LMB. Configure &nmbd;
2076 or any other machine to serve as LMB.</para></listitem>
2077 <listitem><para>You cannot log onto the machine that is the LMB.
2078 Can you log on to it as a guest user? </para></listitem>
2079 <listitem><para>There is no IP connectivity to the LMB.
2080 Can you reach it by broadcast?</para></listitem>
2085 <title>Browsing of Shares and Directories is Very Slow</title>
2088 <indexterm><primary>slow browsing</primary></indexterm>
2089 There are only two machines on a test network. One is a Samba server, the other a Windows XP machine.
2090 Authentication and logons work perfectly, but when I try to explore shares on the Samba server, the
2091 Windows XP client becomes unresponsive. Sometimes it does not respond for some minutes. Eventually,
2092 Windows Explorer will respond and displays files and directories without problem.
2097 <indexterm><primary>cmd</primary></indexterm>
2098 But, the share is immediately available from a command shell (<command>cmd</command>, followed by
2099 exploration with DOS command. Is this a Samba problem, or is it a Windows problem? How can I solve this?
2103 Here are a few possibilities:
2108 <term>Bad Networking Hardware</term>
2110 <indexterm><primary>bad hardware</primary></indexterm>
2111 <indexterm><primary>WebClient</primary></indexterm>
2112 <indexterm><primary>defective hardware</primary></indexterm>
2113 <indexterm><primary>Bad networking hardware</primary></indexterm>
2114 <indexterm><primary>data corruption</primary></indexterm>
2115 Most common defective hardware problems center around low cost or defective hubs, routers,
2116 network interface controllers (NICs), and bad wiring. If one piece of hardware is defective,
2117 the whole network may suffer. Bad networking hardware can cause data corruption. Most bad
2118 networking hardware problems are accompanied by an increase in apparent network traffic,
2124 <term>The Windows XP WebClient</term>
2126 <indexterm><primary>network browsing problems</primary></indexterm>
2127 A number of sites have reported similar slow network browsing problems and found that when
2128 the WebClient service is turned off, the problem disappears. This is certainly something
2129 that should be explored because it is a simple solution &smbmdash; if it works.
2134 <term>Inconsistent WINS Configuration</term>
2136 <indexterm><primary>WINS Configuration</primary></indexterm>
2137 <indexterm><primary>WINS server</primary></indexterm>
2138 This type of problem is common when one client is configured to use a WINS server (that is
2139 a TCP/IP configuration setting) and there is no WINS server on the network. Alternatively,
2140 this will happen if there is a WINS server and Samba is not configured to use it. The use of
2141 WINS is highly recommended if the network is using NetBIOS over TCP/IP protocols. If use
2142 of NetBIOS over TCP/IP is disabled on all clients, Samba should not be configured as a WINS
2143 server, nor should it be configured to use one.
2148 <term>Incorrect DNS Configuration</term>
2150 <indexterm><primary>DNS Configuration</primary></indexterm>
2151 <indexterm><primary>NetBIOS over TCP/IP disabled</primary></indexterm>
2152 If use of NetBIOS over TCP/IP is disabled, Active Directory is in use and the DNS server
2153 has been incorrectly configured. For further information refer to
2154 <link linkend="adsdnstech">DNS and Active Directory</link>.