Add all the source files from the old CVS tree,
[tprouty/samba.git] / docs / howto / DNS-DHCP-Configuration.xml
1 <chapter id="DNSDHCP">
2 <chapterinfo>
3         &author.jht;
4 </chapterinfo>
5
6 <title>DNS and DHCP Configuration Guide</title>
7
8 <sect1>
9 <title>Features and Benefits</title>
10
11 <para>
12 There are few subjects in the UNIX world that might raise as much contention as
13 Domain Name System (DNS) and Dynamic Host Configuration Protocol (DHCP).
14 Not all opinions held for or against particular implementations of DNS and DHCP
15 are valid.
16 </para>
17
18 <para>
19 We live in a modern age where many information technology users demand mobility
20 and freedom. Microsoft Windows users in particular expect to be able to plug their
21 notebook computer into a network port and have things <quote>just work.</quote>
22 </para>
23
24 <para>
25 UNIX administrators have a point. Many of the normative practices in the Microsoft
26 Windows world at best border on bad practice from a security perspective.
27 Microsoft Windows networking protocols allow workstations to arbitrarily register
28 themselves on a network. Windows 2000 Active Directory registers entries in the DNS name space
29 that are equally perplexing to UNIX administrators. Welcome to the new world!
30 </para>
31
32
33 <para>
34 <indexterm><primary>ISC</primary><secondary>DNS</secondary></indexterm>
35 <indexterm><primary>ISC</primary><secondary>DHCP</secondary></indexterm>
36 The purpose of this chapter is to demonstrate the configuration of the Internet
37 Software Consortium (ISC) DNS and DHCP servers to provide dynamic services that are
38 compatible with their equivalents in the Microsoft Windows 2000 Server products.
39 </para>
40
41 <para>
42 The purpose of this chapter is to provide no more than a working example of
43 configuration files for both DNS and DHCP servers. The examples used match
44 configuration examples used elsewhere in this document.
45 </para>
46
47 <para>
48 This chapter explicitly does not provide a tutorial, nor does it pretend to be
49 a reference guide on DNS and DHCP, as this is well beyond the scope and intent
50 of this document as a whole. Anyone who wants more detailed reference materials
51 on DNS or DHCP should visit the ISC Web sites at <ulink noescape="1" url="http://www.isc.org">
52 http://www.isc.org</ulink>. Those wanting a written text might also be interested
53 in the O'Reilly publications on these two subjects.
54 </para>
55
56 </sect1>
57
58 <sect1>
59 <title>Example Configuration</title>
60
61 <para>
62 The domain name system is to the Internet what water is to life. By it nearly all
63 information resources (host names) are resolved to their Internet protocol (IP) address.
64 Windows networking tried hard to avoid the complexities of DNS, but alas, DNS won.
65 <indexterm><primary>WINS</primary></indexterm>
66 The alternative to DNS, the Windows Internet Name Service (WINS) an artifact of
67 NetBIOS networking over the TCP/IP protocols, has demonstrated scalability problems as
68 well as a flat non-hierarchical name space that became unmanageable as the size and
69 complexity of information technology networks grew.
70 </para>
71
72 <para>
73 WINS is a Microsoft implementation of the RFC1001/1002 NetBIOS Name Service (NBNS).
74 It allows NetBIOS clients (like Microsoft Windows Machines) to register an arbitrary
75 machine name that the administrator or user has chosen together with the IP
76 address that the machine has been given. Through the use of WINS, network client machines
77 could resolve machine names to their IP address.
78 </para>
79
80 <para>
81 The demand for an alternative to the limitations of NetBIOS networking finally drove
82 Microsoft to use DNS and Active Directory. Microsoft's new implementation attempts
83 to use DNS in a manner similar to the way that WINS is used for NetBIOS networking.
84 Both WINS and Microsoft DNS rely on dynamic name registration.
85 </para> 
86
87 <para>
88 Microsoft Windows clients can perform dynamic name registration to the DNS server
89 on start-up. Alternately, where DHCP is used to assign workstation IP addresses,
90 it is possible to register host names and their IP address by the DHCP server as
91 soon as a client acknowledges an IP address lease. Lastly, Microsoft DNS can resolve
92 hostnames via Microsoft WINS.
93 </para>
94
95 <para>
96 The following configurations demonstrate a simple insecure Dynamic DNS server and
97 a simple DHCP server that matches the DNS configuration.
98 </para>
99
100         <sect2>
101         <title>Dynamic DNS</title>
102
103         <para>
104         <indexterm><primary>DNS</primary><secondary>Dynamic</secondary></indexterm>
105         The example DNS configuration is for a private network in the IP address
106         space for network 192.168.1.0/24. The private class network address space
107         is set forth in RFC1918.
108         </para>
109
110
111         <para>
112         <indexterm><primary>BIND</primary></indexterm>
113         It is assumed that this network will be situated behind a secure firewall.
114         The files that follow work with ISC BIND version 9. BIND is the Berkeley
115         Internet Name Daemon. The following configuration files are offered:
116         </para>
117
118         <para>
119         The master configuration file for <filename>/etc/named.conf</filename>
120         determines the location of all further configuration files used.
121         The location and name of this file is specified in the start-up script
122         that is part of the operating system.
123         <smbfile name="named.conf">
124 <programlisting>
125 # Quenya.Org configuration file
126
127 acl mynet {
128         192.168.1.0/24;
129         127.0.0.1;
130 };
131
132 options {
133
134         directory "/var/named";
135         listen-on-v6 { any; };
136         notify no;
137         forward first;
138         forwarders {
139                 192.168.1.1;
140                 };
141         auth-nxdomain yes;
142         multiple-cnames yes;
143         listen-on {
144                 mynet;
145                 };
146 };
147
148 # The following three zone definitions do not need any modification.
149 # The first one defines localhost while the second defines the
150 # reverse lookup for localhost. The last zone "." is the
151 # definition of the root name servers.
152
153 zone "localhost" in {
154         type master;
155         file "localhost.zone";
156 };
157
158 zone "0.0.127.in-addr.arpa" in {
159         type master;
160         file "127.0.0.zone";
161 };
162
163 zone "." in {
164         type hint;
165         file "root.hint";
166 };
167
168 # You can insert further zone records for your own domains below.
169
170 zone "quenya.org" {
171         type master;
172         file "/var/named/quenya.org.hosts";
173         allow-query {
174                 mynet;
175                 };
176         allow-transfer {
177                 mynet;
178                 };
179         allow-update {
180                 mynet;
181                 };
182         };
183
184 zone "1.168.192.in-addr.arpa" {
185         type master;
186         file "/var/named/192.168.1.0.rev";
187         allow-query {
188                 mynet;
189         };
190         allow-transfer {
191                 mynet;
192         };
193         allow-update {
194                 mynet;
195         };
196 };
197 </programlisting>
198 </smbfile>
199         </para>
200
201         <para>
202         The following files are all located in the directory <filename>/var/named</filename>.
203         This is the <filename>/var/named/localhost.zone</filename> file:
204         <smbfile name="localhost.zone">
205 <programlisting>
206 $TTL 1W
207 @               IN SOA  @   root (
208                                 42              ; serial (d. adams)
209                                 2D              ; refresh
210                                 4H              ; retry
211                                 6W              ; expiry
212                                 1W )            ; minimum
213
214                 IN NS           @
215                 IN A            127.0.0.1
216         </programlisting>
217 </smbfile>
218         </para>
219
220         <para>
221         The <filename>/var/named/127.0.0.zone</filename> file:
222         <smbfile name="127.0.0.0.zone">
223 <programlisting>
224 $TTL 1W
225 @               IN SOA          localhost.  root.localhost. (
226                                 42              ; serial (d. adams)
227                                 2D              ; refresh
228                                 4H              ; retry
229                                 6W              ; expiry
230                                 1W )            ; minimum
231
232                                 IN NS           localhost.
233 1               IN PTR          localhost.
234 </programlisting>
235 </smbfile>
236         </para>
237
238         <para>
239                 The <filename>/var/named/quenya.org.host</filename> file:
240                         <smbfile name="quenya.org.host">
241 <programlisting>
242 $ORIGIN .
243 $TTL 38400      ; 10 hours 40 minutes
244 quenya.org      IN SOA  marvel.quenya.org. root.quenya.org. (
245                                 2003021832 ; serial
246                                 10800      ; refresh (3 hours)
247                                 3600       ; retry (1 hour)
248                                 604800     ; expire (1 week)
249                                 38400      ; minimum (10 hours 40 minutes)
250                                 )
251                         NS      marvel.quenya.org.
252                         MX      10 mail.quenya.org.
253 $ORIGIN quenya.org.
254 frodo                   A       192.168.1.1
255 marvel                  A       192.168.1.2
256 ;
257 mail                    CNAME   marvel
258 www                     CNAME   marvel
259 </programlisting>
260 </smbfile>
261 </para>
262
263 <para>
264         The <filename>/var/named/192.168.1.0.rev</filename> file:
265         <smbfile name="192.168.1.0.rev">
266 <programlisting>
267 $ORIGIN .
268 $TTL 38400      ; 10 hours 40 minutes
269 1.168.192.in-addr.arpa  IN SOA  marvel.quenya.org. root.quenya.org. (
270                                 2003021824 ; serial
271                                 10800      ; refresh (3 hours)
272                                 3600       ; retry (1 hour)
273                                 604800     ; expire (1 week)
274                                 38400      ; minimum (10 hours 40 minutes)
275                                 )
276                         NS      marvel.quenya.org.
277 $ORIGIN 1.168.192.in-addr.arpa.
278 1                       PTR     frodo.quenya.org.
279 2                       PTR     marvel.quenya.org.
280 </programlisting>
281 </smbfile>
282         </para>
283
284         <para>
285         The above were copied from a fully working system. All dynamically registered
286         entries have been removed. In addition to these files, BIND version 9 will
287         create for each of the dynamic registration files a file that has a 
288         <filename>.jnl</filename> extension. Do not edit or tamper with the configuration
289         files or with the <filename>.jnl</filename> files that are created.
290         </para>
291
292         </sect2>
293
294         <sect2 id="DHCP">
295         <title>DHCP Server</title>
296
297         <para>
298         The following file is used with the ISC DHCP Server version 3.
299         The file is located in <filename>/etc/dhcpd.conf</filename>:
300         </para>
301
302         <para>
303                 <smbfile name="dhcpd.conf">
304         <programlisting>
305 ddns-updates on;
306 ddns-domainname "quenya.org";
307 option ntp-servers 192.168.1.2;
308 ddns-update-style ad-hoc;
309 allow unknown-clients;
310 default-lease-time 86400;
311 max-lease-time 172800;
312
313 option domain-name "quenya.org";
314 option domain-name-servers 192.168.1.2;
315 option netbios-name-servers 192.168.1.2;
316 option netbios-dd-server 192.168.1.2;
317 option netbios-node-type 8;
318
319 subnet 192.168.1.0 netmask 255.255.255.0 {
320         range dynamic-bootp 192.168.1.60 192.168.1.254;
321         option subnet-mask 255.255.255.0;
322         option routers 192.168.1.2;
323         allow unknown-clients;
324 }
325 </programlisting>
326 </smbfile>
327         </para>
328
329         <para>
330         In the above example, IP addresses between 192.168.1.1 and 192.168.1.59 are
331         reserved for fixed address (commonly called <constant>hard-wired</constant>) IP addresses. The
332         addresses between 192.168.1.60 and 192.168.1.254 are allocated for dynamic use.
333         </para>
334
335         </sect2>
336
337 </sect1>
338 </chapter>