1<HTML> 2<HEAD> 3<TITLE> 4[Chapter 7] 7.3 Name Resolution with Samba</title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly & Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:35:08Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head> 5<BODY BGCOLOR="#FFFFFF" TEXT="#000000" link="#990000" vlink="#0000CC"> 6<table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%"> 7<tr> 8<td width="25%" valign="TOP"> 9<img hspace=10 vspace=10 src="gifs/samba.s.gif" 10alt="Using Samba" align=left valign=top border=0> 11</td> 12<td height="105" valign="TOP"> 13<br> 14<H2>Using Samba</H2> 15<font size="-1"> 16Robert Eckstein, David Collier-Brown, Peter Kelly 17<br>1st Edition November 1999 18<br>1-56592-449-5, Order Number: 4495 19<br>416 pages, $34.95 20</font> 21<p> <a href="http://www.oreilly.com/catalog/samba/">Buy the hardcopy</a> 22<p><a href="index.html">Table of Contents</a> 23</td> 24</tr> 25</table> 26<hr size=1 noshade> 27<!--sample chapter begins --> 28 29<center> 30<DIV CLASS="htmlnav"> 31<TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 32<TR> 33<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 34<A CLASS="sect1" HREF="ch07_02.html" TITLE="7.2 Printing to Windows Client Printers"> 35<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 7.2 Printing to Windows Client Printers" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 36<B> 37<FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1"> 38<A CLASS="chapter" REL="up" HREF="ch07_01.html" TITLE="7. Printing and Name Resolution"> 39Chapter 7<br> 40Printing and Name Resolution</a></font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 41<A CLASS="chapter" HREF="ch08_01.html" TITLE="8. Additional Samba Information "> 42<IMG SRC="gifs/txtnexta.gif" ALT="Next: 8. Additional Samba Information " BORDER="0"></a></td></tr></table> <hr noshade size=1></center> 43</div> 44<blockquote> 45<div> 46<H2 CLASS="sect1"> 47<A CLASS="title" NAME="ch07-12219"> 487.3 Name Resolution with Samba</a></h2><P CLASS="para">Before NetBIOS Name Servers (NBNS) came about, name resolution worked entirely by broadcast. If you needed a machine's address, you simply broadcast its name across the network and, in theory, the machine itself would reply. This approach is still possible: anyone looking for a machine named <CODE CLASS="literal"> 49fred</code> can still broadcast a query and find out if it exists and what its IP address is. (We use this capability to troubleshoot Samba name services with the <CODE CLASS="literal"> 50nmblookup</code> command in <a href="ch09_01.html"><b>Chapter 9, <CITE CLASS="chapter">Troubleshooting Samba</cite></b></a>.)</p><P CLASS="para"> 51As you saw in the first chapter, however, broadcasting - whether it be browsing or name registration and resolution - does not pass easily across multiple subnets. In addition, many broadcasts tend to bog down networks. To solve this problem, Microsoft now provides the Windows Internet Naming Service (WINS), a cross-subnet NBNS, which Samba supports. With it, an administrator can designate a single machine to act as a WINS server, and can then provide each client that requires name resolution the address of the WINS server. Consequently, name registration and resolution requests can be directed to a single machine from any point on the network, instead of broadcast.</p><P CLASS="para"> 52WINS and broadcasting are not the only means of name resolution, however. There are actually four mechanisms that can be used with Samba:</p><UL CLASS="itemizedlist"> 53<LI CLASS="listitem"> 54<P CLASS="para"> 55<A CLASS="listitem" NAME="ch07-pgfId-950848"> 56</a>WINS</p></li><LI CLASS="listitem"> 57<P CLASS="para"> 58<A CLASS="listitem" NAME="ch07-pgfId-950856"> 59</a>Broadcasting</p></li><LI CLASS="listitem"> 60<P CLASS="para"> 61<A CLASS="listitem" NAME="ch07-pgfId-950851"> 62</a>Unix <I CLASS="filename"> 63/etc/hosts</i> or NIS/NIS+ matches</p></li><LI CLASS="listitem"> 64<P CLASS="para"> 65<A CLASS="listitem" NAME="ch07-pgfId-951953"> 66</a><EM CLASS="emphasis"> 67LMHOSTS</em> file</p></li></ul><P CLASS="para"> 68Samba can use any or all of these name resolution methods in the order that you specify in the Samba configuration file using the <CODE CLASS="literal"> 69name</code> <CODE CLASS="literal"> 70resolve</code> <CODE CLASS="literal"> 71order</code> parameter. However, before delving into configuration options, let's discuss the one that you've probably not encountered before: the <I CLASS="filename"> 72LMHOSTS</i> file.</p><DIV CLASS="sect2"> 73<H3 CLASS="sect2"> 74<A CLASS="title" NAME="ch07-pgfId-949950"> 757.3.1 The LMHOSTS File</a></h3><P CLASS="para"> 76<I CLASS="filename"> 77LMHOSTS</i> is the standard LAN Manager <EM CLASS="emphasis"> 78hosts</em> file used to resolve names into IP addresses on the system. It is the NBT equivalent of the <I CLASS="filename"> 79/etc/hosts</i> file that is standard on all Unix systems. By default, the file is usually stored as <I CLASS="filename"> 80/usr/local/samba/lib/LMHOSTS</i> and shares a format similar to <I CLASS="filename"> 81/etc/hosts</i>. For example:</p><PRE CLASS="programlisting"> 82192.168.220.100 hydra 83192.168.220.101 phoenix</pre><P CLASS="para"> 84The only difference is that the names on the right side of the entries are NetBIOS names instead of DNS names. Because they are NetBIOS names, you can assign resource types to them as well:</p><PRE CLASS="programlisting"> 85192.168.220.100 hydra#20 86192.168.220.100 simple#1b 87192.168.220.101 phoenix#20</pre><P CLASS="para"> 88Here, we've assigned the <CODE CLASS="literal"> 89hydra</code> machine to be the primary domain controller of the <CODE CLASS="literal"> 90SIMPLE</code> domain, as indicated by the resource type <1B> assigned to the name after <CODE CLASS="literal"> 91hydra</code>'s IP address in the second line. The other two are standard workstations.</p><P CLASS="para"> 92If you wish to place an <EM CLASS="emphasis"> 93LMHOSTS</em> file somewhere other than the default location, you will need to notify the <EM CLASS="emphasis"> 94nmbd</em> process upon start up, as follows:</p><PRE CLASS="programlisting"> 95nmbd -H /etc/samba/lmhosts -D</pre></div><DIV CLASS="sect2"> 96<H3 CLASS="sect2"> 97<A CLASS="title" NAME="ch07-pgfId-951120"> 987.3.2 Setting Up Samba to Use Another WINS Server</a></h3><P CLASS="para">You can set up Samba to use a WINS server somewhere else on the network by simply pointing it to the IP address of the WINS server. This is done with the global <CODE CLASS="literal"> 99wins</code> <CODE CLASS="literal"> 100server</code> configuration option, as shown here:</p><PRE CLASS="programlisting"> 101[global] 102 wins server = 192.168.200.122</pre><P CLASS="para"> 103With this option enabled, Samba will direct all WINS requests to the server at 192.168.200.122. Note that because the request is directed at a single machine, we don't have to worry about any of the problems inherent to broadcasting. However, though you have specified an IP address for a WINS server in the configuration file, Samba will not necessarily use the WINS server before other forms of name resolution. The order in which Samba attempts various name-resolution techniques is given with the <CODE CLASS="literal"> 104name</code> <CODE CLASS="literal"> 105resolve</code> <CODE CLASS="literal"> 106order</code> configuration option, which we will discuss shortly.</p><P CLASS="para"> 107If you have a Samba server on a subnet that still uses broadcasting and the Samba server knows the correct location of a WINS server on another subnet, you can configure the Samba server to forward any name resolution requests with the <CODE CLASS="literal"> 108wins</code> <CODE CLASS="literal"> 109proxy</code> option:</p><PRE CLASS="programlisting"> 110[global] 111 wins server = 192.168.200.12 112 wins proxy = yes</pre><P CLASS="para"> 113Use this only in situations where the WINS server resides on another subnet. Otherwise, the broadcast will reach the WINS server regardless of any proxying.</p></div><DIV CLASS="sect2"> 114<H3 CLASS="sect2"> 115<A CLASS="title" NAME="ch07-83429"> 1167.3.3 Setting Up Samba as a WINS Server</a></h3><P CLASS="para">You can set up Samba as a WINS server by setting two global options in the configuration file, as shown below:</p><PRE CLASS="programlisting"> 117[global] 118 wins support = yes 119 name resolve order = wins lmhosts hosts bcast</pre><P CLASS="para"> 120The <CODE CLASS="literal"> 121wins</code> <CODE CLASS="literal"> 122support</code> option turns Samba into a WINS server. Believe it or not, that's all you need to do! Samba handles the rest of the details behind the scenes, leaving you a relaxed administrator. The <CODE CLASS="literal"> 123wins</code> <CODE CLASS="literal"> 124support=yes</code> and the <CODE CLASS="literal"> 125wins</code> <CODE CLASS="literal"> 126server</code> option are mutually exclusive; you cannot simultaneously offer Samba as the WINS server and point to another system as the server.</p><P CLASS="para"> 127If Samba is acting as a WINS server, you should probably get familiar with the <CODE CLASS="literal"> 128name</code> <CODE CLASS="literal"> 129resolve</code> <CODE CLASS="literal"> 130order</code> option mentioned earlier. This option tells Samba the order of methods in which it tries to resolve a NetBIOS name. It can take up to four values:</p><DL CLASS="variablelist"> 131<DT CLASS="term"> 132lmhosts</dt><DD CLASS="listitem"> 133<P CLASS="para"> 134Uses a LAN Manager <EM CLASS="emphasis"> 135LMHOSTS</em> file</p></dd><DT CLASS="term"> 136hosts</dt><DD CLASS="listitem"> 137<P CLASS="para"> 138Uses the standard name resolution methods of the Unix system, <EM CLASS="emphasis"> 139/etc/hosts</em>, DNS, NIS, or a combination (as configured for the system)</p></dd><DT CLASS="term"> 140wins</dt><DD CLASS="listitem"> 141<P CLASS="para"> 142Uses the WINS server</p></dd><DT CLASS="term"> 143bcast</dt><DD CLASS="listitem"> 144<P CLASS="para"> 145Uses a broadcast method</p></dd></dl><P CLASS="para"> 146The order in which you specify them in the value is the order in which Samba will attempt name resolution when acting as a WINS server. For example, let's look at the value specified previously:</p><PRE CLASS="programlisting"> 147name resolve order = wins lmhosts hosts bcast</pre><P CLASS="para"> 148This means that Samba will attempt to use its WINS entries first for name resolution, followed by the LAN Manager <EM CLASS="emphasis"> 149LMHOSTS</em> file on its system. Next, the hosts value causes it to use Unix name resolution methods. The word <CODE CLASS="literal"> 150hosts</code> may be misleading; it covers not only the <I CLASS="filename"> 151/etc/hosts</i> file, but also the use of DNS or NIS (as configured on the Unix host). Finally, if those three do not work, it will use a broadcast to try to locate the correct machine.</p><P CLASS="para"> 152Finally, you can instruct a Samba server that is acting as a WINS server to check with the system's DNS server if a requested host cannot be found in its WINS database. With a typical Linux system, for example, you can find the IP address of the DNS server by searching the <I CLASS="filename"> 153/etc/resolv.conf</i> file. In it, you might see an entry such as the following:</p><PRE CLASS="programlisting"> 154nameserver 127.0.0.1 155nameserver 192.168.200.192</pre><P CLASS="para"> 156This tells us that a DNS server is located at 192.168.220.192. (The 127.0.0.1 is the localhost address and is never a valid DNS server address.) </p><P CLASS="para"> 157Use the global <CODE CLASS="literal"> 158dns</code> <CODE CLASS="literal"> 159proxy</code> option to alert Samba to use the configured DNS server:</p><PRE CLASS="programlisting"> 160[global] 161 wins support = yes 162 name resolve order = wins lmhosts hosts bcast 163 dns proxy = yes</pre></div><DIV CLASS="sect2"> 164<H3 CLASS="sect2"> 165<A CLASS="title" NAME="ch07-pgfId-949952"> 1667.3.4 Name Resolution Configuration Options</a></h3><P CLASS="para">Samba's WINS options are shown in <A CLASS="xref" HREF="ch07_03.html#ch07-82331"> 167Table 7.5</a>. </p><br> 168<TABLE CLASS="table" BORDER="1" CELLPADDING="3"> 169<CAPTION CLASS="table"> 170<A CLASS="title" NAME="ch07-82331"> 171Table 7.5: WINS Options </a></caption><THEAD CLASS="thead"> 172<TR CLASS="row" VALIGN="TOP"> 173<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 174<P CLASS="para"> 175Option</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 176<P CLASS="para"> 177Parameters</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 178<P CLASS="para"> 179Function</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 180<P CLASS="para"> 181Default</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 182<P CLASS="para"> 183Scope</p></th></tr></thead><TBODY CLASS="tbody"> 184<TR CLASS="row" VALIGN="TOP"> 185<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 186<P CLASS="para"> 187<CODE CLASS="literal"> 188wins support</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 189<P CLASS="para"> 190boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 191<P CLASS="para"> 192If set to <CODE CLASS="literal"> 193yes</code>, Samba will act as a WINS server.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 194<P CLASS="para"> 195<CODE CLASS="literal"> 196no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 197<P CLASS="para"> 198Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 199<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 200<P CLASS="para"> 201<CODE CLASS="literal"> 202wins server</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 203<P CLASS="para"> 204string (IP address or DNS name)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 205<P CLASS="para"> 206Identifies a WINS server for Samba to use for name registration and resolution.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 207<P CLASS="para"> 208None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 209<P CLASS="para"> 210Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 211<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 212<P CLASS="para"> 213<CODE CLASS="literal"> 214wins proxy</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 215<P CLASS="para"> 216boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 217<P CLASS="para"> 218Allows Samba to act as a proxy to a WINS server on another subnet.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 219<P CLASS="para"> 220<CODE CLASS="literal"> 221no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 222<P CLASS="para"> 223Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 224<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 225<P CLASS="para"> 226<CODE CLASS="literal"> 227dns proxy</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 228<P CLASS="para"> 229boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 230<P CLASS="para"> 231If set to <CODE CLASS="literal"> 232yes</code>, a Samba WINS server will search DNS if it cannot find a name in WINS.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 233<P CLASS="para"> 234<CODE CLASS="literal"> 235no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 236<P CLASS="para"> 237Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 238<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 239<P CLASS="para"> 240<CODE CLASS="literal"> 241name resolve order</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 242<P CLASS="para"> 243<CODE CLASS="literal"> 244lmhosts</code>, <CODE CLASS="literal"> 245hosts</code>, <CODE CLASS="literal"> 246wins</code>, or <CODE CLASS="literal"> 247bcast</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 248<P CLASS="para"> 249Specifies an order of the methods used to resolve NetBIOS names.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 250<P CLASS="para"> 251<CODE CLASS="literal"> 252lmhosts hosts wins bcast</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 253<P CLASS="para"> 254Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 255<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 256<P CLASS="para"> 257<CODE CLASS="literal"> 258max ttl</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 259<P CLASS="para"> 260numerical</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 261<P CLASS="para"> 262Specifies the maximum time-to-live in seconds for a requested NetBIOS names.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 263<P CLASS="para"> 264<CODE CLASS="literal"> 265259200</code> (3 days)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 266<P CLASS="para"> 267Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 268<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 269<P CLASS="para"> 270<CODE CLASS="literal"> 271max wins ttl</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 272<P CLASS="para"> 273numerical</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 274<P CLASS="para"> 275Specifies the maximum time-to-live in seconds for NetBIOS names given out by Samba as a WINS server.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 276<P CLASS="para"> 277<CODE CLASS="literal"> 278518400</code> (6 days)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 279<P CLASS="para"> 280Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 281<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 282<P CLASS="para"> 283<CODE CLASS="literal"> 284min wins ttl</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 285<P CLASS="para"> 286numerical</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 287<P CLASS="para"> 288Specifies the minimum time-to-live in seconds for NetBIOS names given out by Samba as a WINS server.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 289<P CLASS="para"> 290<CODE CLASS="literal"> 29121600</code> (6 hours)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 292<P CLASS="para"> 293Global</p></td></tr></tbody></table><DIV CLASS="sect3"> 294<H4 CLASS="sect3"> 295<A CLASS="title" NAME="ch07-pgfId-946762"> 2967.3.4.1 wins support</a></h4><P CLASS="para"> 297Samba will provide WINS name service to all machines in the network if you set the following in the <CODE CLASS="literal"> 298[global]</code> section of the <I CLASS="filename"> 299smb.conf</i> file:</p><PRE CLASS="programlisting"> 300[global] 301 wins support = yes</pre><P CLASS="para"> 302The default value is <CODE CLASS="literal"> 303no</code>, which is typically used to allow another Windows NT server to become a WINS server. If you do enable this option, remember that a Samba WINS server currently cannot exchange data with any backup WINS servers. If activated, this option is mutually exclusive with the <CODE CLASS="literal"> 304wins</code> <CODE CLASS="literal"> 305server</code> parameter; you cannot set both to <CODE CLASS="literal"> 306yes</code> at the same time or Samba will flag an error.</p></div><DIV CLASS="sect3"> 307<H4 CLASS="sect3"> 308<A CLASS="title" NAME="ch07-pgfId-946766"> 3097.3.4.2 wins server</a></h4><P CLASS="para"> 310Samba will use an existing WINS server on the network if you specify the <CODE CLASS="literal"> 311wins</code> <CODE CLASS="literal"> 312server</code> global option in your configuration file. The value of this option is either the IP address or DNS name (not NetBIOS name) of the WINS server. For example:</p><PRE CLASS="programlisting"> 313[global] 314 wins server = 192.168.220.110</pre><P CLASS="para"> 315or:</p><PRE CLASS="programlisting"> 316[global] 317 wins server = wins.example.com</pre><P CLASS="para"> 318In order for this option to work, the <CODE CLASS="literal"> 319wins</code> <CODE CLASS="literal"> 320support</code> option must be set to <CODE CLASS="literal"> 321no</code> (the default). Otherwise, Samba will report an error. You can specify only one WINS server using this option.</p></div><DIV CLASS="sect3"> 322<H4 CLASS="sect3"> 323<A CLASS="title" NAME="ch07-pgfId-947973"> 3247.3.4.3 wins proxy</a></h4><P CLASS="para"> 325This option allows Samba to act as a proxy to another WINS server, and thus relay name registration and resolution requests from itself to the real WINS server, often outside the current subnet. The WINS server can be indicated through the <CODE CLASS="literal"> 326wins</code> <CODE CLASS="literal"> 327server</code> option. The proxy will then return the WINS response back to the client. You can enable this option by specifying the following in the <CODE CLASS="literal"> 328[global]</code> section:</p><PRE CLASS="programlisting"> 329[global] 330 wins proxy = yes</pre></div><DIV CLASS="sect3"> 331<H4 CLASS="sect3"> 332<A CLASS="title" NAME="ch07-pgfId-946778"> 3337.3.4.4 dns proxy</a></h4><P CLASS="para"> 334If you want the domain name service (DNS) to be used if a name isn't found in WINS, you can set the following option:</p><PRE CLASS="programlisting"> 335[global] 336 dns proxy = yes</pre><P CLASS="para"> 337This will cause <I CLASS="filename"> 338nmbd</i> to query for machine names using the server's standard domain name service. You may wish to deactivate this option if you do not have a permanent connection to your DNS server. Despite this option, we recommend using a WINS server. If you don't already have any WINS servers on your network, make one Samba machine a WINS server. Do not, however, make two Samba machines WINS servers (one primary and one backup) as they currently cannot exchange WINS databases.</p></div><DIV CLASS="sect3"> 339<H4 CLASS="sect3"> 340<A CLASS="title" NAME="ch07-pgfId-949945"> 3417.3.4.5 name resolve order</a></h4><P CLASS="para"> 342The global <CODE CLASS="literal"> 343name</code> <CODE CLASS="literal"> 344resolve</code> <CODE CLASS="literal"> 345order</code> option specifies the order of services that Samba will use in attempting name resolution. The default order is to use the <EM CLASS="emphasis"> 346LMHOSTS</em> file, followed by standard Unix name resolution methods (some combination of <I CLASS="filename"> 347/etc/hosts</i>, DNS, and NIS), then query a WINS server, and finally use broadcasting to determine the address of a NetBIOS name. You can override this option by specifying something like the following:</p><PRE CLASS="programlisting"> 348[global] 349 name resolve order = lmhosts wins hosts bcast</pre><P CLASS="para"> 350This causes resolution to use the <EM CLASS="emphasis"> 351LMHOSTS</em> file first, followed by a query to a WINS server, the system password file, and finally broadcasting. You need not use all four options if you don't want to. This option is covered in more detail in the section <A CLASS="xref" HREF="ch07_03.html#ch07-83429"> 352Section 7.3.3, Setting Up Samba as a WINS Server</a>, earlier in this chapter.</p></div><DIV CLASS="sect3"> 353<H4 CLASS="sect3"> 354<A CLASS="title" NAME="ch07-pgfId-949986"> 3557.3.4.6 max ttl</a></h4><P CLASS="para"> 356This option gives the maximum time to live (TTL) during which a NetBIOS name registered with the Samba server will remain active. You should never need to alter this value.</p></div><DIV CLASS="sect3"> 357<H4 CLASS="sect3"> 358<A CLASS="title" NAME="ch07-pgfId-949988"> 3597.3.4.7 max wins ttl</a></h4><P CLASS="para"> 360This option give the maximum time to live (TTL) during which a NetBIOS name resolved from a WINS server will remain active. You should never need to change this value from its default.</p></div><DIV CLASS="sect3"> 361<H4 CLASS="sect3"> 362<A CLASS="title" NAME="ch07-pgfId-949990"> 3637.3.4.8 min wins ttl</a></h4><P CLASS="para"> 364This option give the minimum time to live (TTL) during which a NetBIOS name resolved from a WINS server will remain active. You should never need to alter this value from its default. </p></div></div></div></blockquote> 365<div> 366<center> 367<hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 368<TR> 369<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 370<A CLASS="sect1" HREF="ch07_02.html" TITLE="7.2 Printing to Windows Client Printers"> 371<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 7.2 Printing to Windows Client Printers" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 372<A CLASS="book" HREF="index.html" TITLE=""> 373<IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 374<A CLASS="chapter" HREF="ch08_01.html" TITLE="8. Additional Samba Information "> 375<IMG SRC="gifs/txtnexta.gif" ALT="Next: 8. Additional Samba Information " BORDER="0"></a></td></tr><TR> 376<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 3777.2 Printing to Windows Client Printers</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 378<A CLASS="index" HREF="inx.html" TITLE="Book Index"> 379<IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 3808. Additional Samba Information </td></tr></table><hr noshade size=1></center> 381</div> 382 383<!-- End of sample chapter --> 384<CENTER> 385<FONT SIZE="1" FACE="Verdana, Arial, Helvetica"> 386<A HREF="http://www.oreilly.com/"> 387<B>O'Reilly Home</B></A> <B> | </B> 388<A HREF="http://www.oreilly.com/sales/bookstores"> 389<B>O'Reilly Bookstores</B></A> <B> | </B> 390<A HREF="http://www.oreilly.com/order_new/"> 391<B>How to Order</B></A> <B> | </B> 392<A HREF="http://www.oreilly.com/oreilly/contact.html"> 393<B>O'Reilly Contacts<BR></B></A> 394<A HREF="http://www.oreilly.com/international/"> 395<B>International</B></A> <B> | </B> 396<A HREF="http://www.oreilly.com/oreilly/about.html"> 397<B>About O'Reilly</B></A> <B> | </B> 398<A HREF="http://www.oreilly.com/affiliates.html"> 399<B>Affiliated Companies</B></A><p> 400<EM>© 1999, O'Reilly & Associates, Inc.</EM> 401</FONT> 402</CENTER> 403</BODY> 404</html> 405