[0931098] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY bind-download-http "http://gd.tuwien.ac.at/infosys/servers/isc/bind9/&bind-version;/bind-&bind-version;.tar.gz">
|
---|
| 8 | <!ENTITY bind-download-ftp "ftp://ftp.isc.org/isc/bind9/&bind-version;/bind-&bind-version;.tar.gz">
|
---|
| 9 | <!ENTITY bind-size "4.4 MB">
|
---|
| 10 | <!ENTITY bind-buildsize "88 MB">
|
---|
| 11 | <!ENTITY bind-time "0.89 SBU">
|
---|
| 12 |
|
---|
| 13 | ]>
|
---|
| 14 |
|
---|
[814d190] | 15 | <sect1 id="bind" xreflabel="BIND-&bind-version;">
|
---|
[a0f03b0] | 16 | <sect1info>
|
---|
[5cd0959d] | 17 | <othername>$LastChangedBy$</othername>
|
---|
| 18 | <date>$Date$</date>
|
---|
[a0f03b0] | 19 | </sect1info>
|
---|
[00bb024c] | 20 | <?dbhtml filename="bind.html"?>
|
---|
[40330fcd] | 21 | <title><acronym>BIND</acronym>-&bind-version;</title>
|
---|
[f45b1953] | 22 |
|
---|
[0931098] | 23 | <sect2>
|
---|
| 24 | <title>Introduction to <application><acronym>BIND</acronym></application></title>
|
---|
| 25 |
|
---|
| 26 | <para>The <application><acronym>BIND</acronym></application> package
|
---|
| 27 | provides a <acronym>DNS</acronym> server and client utilities. If you
|
---|
| 28 | are only interested in the utilities, refer to the <xref linkend="bind-utils"/>.</para>
|
---|
| 29 |
|
---|
| 30 | <sect3><title>Package information</title>
|
---|
| 31 | <itemizedlist spacing='compact'>
|
---|
| 32 | <listitem><para>Download (HTTP): <ulink url="&bind-download-http;"/></para></listitem>
|
---|
| 33 | <listitem><para>Download (FTP): <ulink url="&bind-download-ftp;"/></para></listitem>
|
---|
| 34 | <listitem><para>Download size: &bind-size;</para></listitem>
|
---|
| 35 | <listitem><para>Estimated Disk space required: &bind-buildsize;</para></listitem>
|
---|
| 36 | <listitem><para>Estimated build time: &bind-time;</para></listitem></itemizedlist>
|
---|
| 37 | </sect3>
|
---|
| 38 |
|
---|
| 39 | <sect3><title><application><acronym>BIND</acronym></application> dependencies</title>
|
---|
| 40 | <sect4><title>Optional</title>
|
---|
[4008b19] | 41 | <para>
|
---|
| 42 | <xref linkend="openssl"/>,
|
---|
| 43 | <xref linkend="db"/>,
|
---|
| 44 | <xref linkend="openjade"/> and
|
---|
| 45 | <xref linkend="jadetex"/>
|
---|
[0931098] | 46 | </para></sect4>
|
---|
| 47 | </sect3>
|
---|
| 48 |
|
---|
| 49 | </sect2>
|
---|
| 50 |
|
---|
| 51 | <sect2>
|
---|
| 52 | <title>Installation of <application><acronym>BIND</acronym></application></title>
|
---|
| 53 |
|
---|
| 54 | <para>Install <application><acronym>BIND</acronym></application> by
|
---|
| 55 | running the following commands:</para>
|
---|
| 56 |
|
---|
| 57 | <screen><userinput><command>./configure --prefix=/usr --sysconfdir=/etc &&
|
---|
| 58 | make &&
|
---|
| 59 | make install</command></userinput></screen>
|
---|
| 60 |
|
---|
| 61 | </sect2>
|
---|
| 62 |
|
---|
| 63 | <sect2>
|
---|
| 64 | <title>Configuring
|
---|
| 65 | <application><acronym>BIND</acronym></application></title>
|
---|
| 66 |
|
---|
| 67 | <sect3><title>Config files</title>
|
---|
| 68 | <para><filename>named.conf</filename>, <filename>root.hints</filename>,
|
---|
| 69 | <filename>127.0.0</filename>, <filename>rndc.conf</filename></para>
|
---|
| 70 | </sect3>
|
---|
| 71 |
|
---|
| 72 | <sect3><title>Configuration Information</title>
|
---|
| 73 |
|
---|
| 74 | <para>We will configure
|
---|
| 75 | <application><acronym>BIND</acronym></application> to run in a chroot
|
---|
| 76 | jail as an unprivileged user (named). This configuration is more secure
|
---|
| 77 | in that a <acronym>DNS</acronym> compromise can only affect a few files
|
---|
| 78 | in the named user's <envar>HOME</envar> directory.</para>
|
---|
| 79 |
|
---|
| 80 | <para>First we create the unprivileged user and group named:</para>
|
---|
| 81 |
|
---|
| 82 | <screen><userinput><command>groupadd named &&
|
---|
| 83 | useradd -m -g named -s /bin/false named</command></userinput></screen>
|
---|
| 84 |
|
---|
| 85 | <para>Then we set up some files, directories and devices needed by
|
---|
| 86 | <application><acronym>BIND</acronym></application>:</para>
|
---|
| 87 |
|
---|
| 88 | <screen><userinput><command>cd /home/named &&
|
---|
| 89 | mkdir -p dev etc/namedb/slave var/run &&
|
---|
| 90 | mknod /home/named/dev/null c 1 3 &&
|
---|
| 91 | mknod /home/named/dev/random c 1 8 &&
|
---|
| 92 | chmod 666 /home/named/dev/{null,random} &&
|
---|
| 93 | mkdir /home/named/etc/namedb/pz &&
|
---|
| 94 | cp /etc/localtime /home/named/etc</command></userinput></screen>
|
---|
| 95 |
|
---|
| 96 | <para>Create the <filename>named.conf</filename> file from which named
|
---|
| 97 | will read the location of zone files, root name servers and secure
|
---|
| 98 | <acronym>DNS</acronym> keys:</para>
|
---|
| 99 |
|
---|
| 100 | <screen><userinput><command>cat > /home/named/etc/named.conf << "EOF"</command>
|
---|
| 101 | options {
|
---|
| 102 | directory "/etc/namedb";
|
---|
| 103 | pid-file "/var/run/named.pid";
|
---|
| 104 | statistics-file "/var/run/named.stats";
|
---|
| 105 |
|
---|
| 106 | };
|
---|
| 107 | controls {
|
---|
| 108 | inet 127.0.0.1 allow { localhost; } keys { rndc_key; };
|
---|
| 109 | };
|
---|
| 110 | key "rndc_key" {
|
---|
| 111 | algorithm hmac-md5;
|
---|
| 112 | secret "<replaceable>[c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K]</replaceable>";
|
---|
| 113 | };
|
---|
| 114 | zone "." {
|
---|
| 115 | type hint;
|
---|
| 116 | file "root.hints";
|
---|
| 117 | };
|
---|
| 118 | zone "0.0.127.in-addr.arpa" {
|
---|
| 119 | type master;
|
---|
| 120 | file "pz/127.0.0";
|
---|
| 121 | };
|
---|
| 122 | <command>EOF</command></userinput></screen>
|
---|
| 123 |
|
---|
| 124 | <para>Create a zone file with the following contents:</para>
|
---|
| 125 |
|
---|
| 126 | <screen><userinput><command>cat > /home/named/etc/namedb/pz/127.0.0 << "EOF"</command>
|
---|
| 127 | $TTL 3D
|
---|
| 128 | @ IN SOA ns.local.domain. hostmaster.local.domain. (
|
---|
| 129 | 1 ; Serial
|
---|
| 130 | 8H ; Refresh
|
---|
| 131 | 2H ; Retry
|
---|
| 132 | 4W ; Expire
|
---|
| 133 | 1D) ; Minimum TTL
|
---|
| 134 | NS ns.local.domain.
|
---|
| 135 | 1 PTR localhost.
|
---|
| 136 | <command>EOF</command></userinput></screen>
|
---|
| 137 |
|
---|
| 138 | <para>Create the <filename>root.hints</filename> file with the following
|
---|
| 139 | commands:</para>
|
---|
| 140 |
|
---|
| 141 | <note><para>Caution must be used to ensure no leading spaces in this
|
---|
| 142 | file.</para></note>
|
---|
| 143 |
|
---|
| 144 | <screen><userinput><command>cat > /home/named/etc/namedb/root.hints << "EOF"</command>
|
---|
| 145 | . 6D IN NS A.ROOT-SERVERS.NET.
|
---|
| 146 | . 6D IN NS B.ROOT-SERVERS.NET.
|
---|
| 147 | . 6D IN NS C.ROOT-SERVERS.NET.
|
---|
| 148 | . 6D IN NS D.ROOT-SERVERS.NET.
|
---|
| 149 | . 6D IN NS E.ROOT-SERVERS.NET.
|
---|
| 150 | . 6D IN NS F.ROOT-SERVERS.NET.
|
---|
| 151 | . 6D IN NS G.ROOT-SERVERS.NET.
|
---|
| 152 | . 6D IN NS H.ROOT-SERVERS.NET.
|
---|
| 153 | . 6D IN NS I.ROOT-SERVERS.NET.
|
---|
| 154 | . 6D IN NS J.ROOT-SERVERS.NET.
|
---|
| 155 | . 6D IN NS K.ROOT-SERVERS.NET.
|
---|
| 156 | . 6D IN NS L.ROOT-SERVERS.NET.
|
---|
| 157 | . 6D IN NS M.ROOT-SERVERS.NET.
|
---|
| 158 | A.ROOT-SERVERS.NET. 6D IN A 198.41.0.4
|
---|
| 159 | B.ROOT-SERVERS.NET. 6D IN A 128.9.0.107
|
---|
| 160 | C.ROOT-SERVERS.NET. 6D IN A 192.33.4.12
|
---|
| 161 | D.ROOT-SERVERS.NET. 6D IN A 128.8.10.90
|
---|
| 162 | E.ROOT-SERVERS.NET. 6D IN A 192.203.230.10
|
---|
| 163 | F.ROOT-SERVERS.NET. 6D IN A 192.5.5.241
|
---|
| 164 | G.ROOT-SERVERS.NET. 6D IN A 192.112.36.4
|
---|
| 165 | H.ROOT-SERVERS.NET. 6D IN A 128.63.2.53
|
---|
| 166 | I.ROOT-SERVERS.NET. 6D IN A 192.36.148.17
|
---|
| 167 | J.ROOT-SERVERS.NET. 6D IN A 192.58.128.30
|
---|
| 168 | K.ROOT-SERVERS.NET. 6D IN A 193.0.14.129
|
---|
| 169 | L.ROOT-SERVERS.NET. 6D IN A 198.32.64.12
|
---|
| 170 | M.ROOT-SERVERS.NET. 6D IN A 202.12.27.33
|
---|
| 171 | <command>EOF</command></userinput></screen>
|
---|
| 172 |
|
---|
| 173 | <para>The <filename>root.hints</filename> file is a list of root name
|
---|
| 174 | servers. This file must be updated periodically with the
|
---|
| 175 | <command>dig</command> utility.
|
---|
| 176 | Consult the <ulink url="http://www.bind9.net/Bv9ARM.html"><application><acronym>BIND</acronym></application> 9 Administrator Reference Manual</ulink> for
|
---|
| 177 | details.</para>
|
---|
| 178 |
|
---|
| 179 | <para>Create the <filename>rndc.conf</filename> with the following commands:</para>
|
---|
| 180 |
|
---|
| 181 | <screen><userinput><command>cat > /etc/rndc.conf << "EOF"</command>
|
---|
| 182 | key rndc_key {
|
---|
| 183 | algorithm "hmac-md5";
|
---|
| 184 | secret
|
---|
| 185 | "<replaceable>[c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K]</replaceable>";
|
---|
| 186 | };
|
---|
| 187 | options {
|
---|
| 188 | default-server localhost;
|
---|
| 189 | default-key rndc_key;
|
---|
| 190 | };
|
---|
| 191 | <command>EOF</command></userinput></screen>
|
---|
| 192 |
|
---|
| 193 | <para>The <filename>rndc.conf</filename> file contains information for
|
---|
| 194 | controlling named operations with the <command>rndc</command>
|
---|
| 195 | utility.</para>
|
---|
| 196 |
|
---|
| 197 | <para>Create or modify <filename>resolv.conf</filename> to use the new
|
---|
| 198 | name server with the following commands:</para>
|
---|
| 199 |
|
---|
| 200 | <note><para>Replace yourdomain.com with your own valid domain
|
---|
| 201 | name.</para></note>
|
---|
| 202 |
|
---|
| 203 | <screen><userinput><command>cp /etc/resolv.conf /etc/resolv.conf.bak &&
|
---|
| 204 | cat > /etc/resolv.conf << "EOF"</command>
|
---|
| 205 | search <replaceable>[yourdomain.com]</replaceable>
|
---|
| 206 | nameserver 127.0.0.1
|
---|
| 207 | <command>EOF</command></userinput></screen>
|
---|
| 208 |
|
---|
| 209 | <para>Set permissions on the chroot jail with the following
|
---|
| 210 | command:</para>
|
---|
| 211 |
|
---|
| 212 | <screen><userinput><command>chown -R named.named /home/named</command></userinput></screen>
|
---|
| 213 |
|
---|
| 214 | <para>To start the DNS server at boot, install the <filename>/etc/rc.d/init.d/bind</filename>
|
---|
| 215 | init script included in the <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
| 216 |
|
---|
| 217 | <screen><userinput><command>make install-bind</command></userinput></screen>
|
---|
| 218 |
|
---|
| 219 | <para>Now start <application><acronym>BIND</acronym></application> with
|
---|
| 220 | the new boot script:</para>
|
---|
| 221 |
|
---|
| 222 | <screen><userinput><command>/etc/rc.d/init.d/bind start</command></userinput></screen>
|
---|
| 223 |
|
---|
| 224 | </sect3>
|
---|
| 225 |
|
---|
| 226 | <sect3><title>Testing <application><acronym>BIND</acronym></application></title>
|
---|
| 227 |
|
---|
| 228 | <para>Test out the new
|
---|
| 229 | <application><acronym>BIND</acronym></application> 9 installation. First
|
---|
| 230 | query the local host address with <command>dig</command>:</para>
|
---|
| 231 |
|
---|
| 232 | <screen><userinput><command>dig -x 127.0.0.1</command></userinput></screen>
|
---|
| 233 |
|
---|
| 234 | <para>Now try an external name lookup, taking note of the speed
|
---|
| 235 | difference in repeated lookups due to the caching. Run the dig command
|
---|
| 236 | twice on the same address:</para>
|
---|
| 237 |
|
---|
| 238 | <para><screen><userinput><command>dig beyond.linuxfromscratch.org &&
|
---|
| 239 | dig beyond.linuxfromscratch.org</command></userinput></screen>
|
---|
| 240 | You can see almost instantaneous results with the named caching lookups.
|
---|
| 241 | Consult <filename>bind-&bind-version;/doc/arm/Bv9ARM.html</filename>,
|
---|
| 242 | the <application><acronym>BIND</acronym></application> Administrator
|
---|
| 243 | Reference Manual for further configuration options.</para>
|
---|
| 244 |
|
---|
| 245 | </sect3>
|
---|
| 246 |
|
---|
| 247 | </sect2>
|
---|
| 248 |
|
---|
| 249 | <sect2>
|
---|
| 250 | <title>Contents</title>
|
---|
| 251 |
|
---|
| 252 | <para>The <application><acronym>BIND</acronym></application> package contains
|
---|
| 253 | <command>dig</command>,
|
---|
| 254 | <command>host</command>,
|
---|
| 255 | <command>isc-config.sh</command>,
|
---|
| 256 | <command>nslookup</command>,
|
---|
| 257 | <command>rndc</command>,
|
---|
| 258 | <command>rndc-confgen</command>,
|
---|
| 259 | <command>named-checkconf</command>,
|
---|
| 260 | <command>named-checkzone</command>,
|
---|
| 261 | <command>lwresd</command>,
|
---|
| 262 | <command>named</command>,
|
---|
| 263 | <command>dnssec-signzone</command>,
|
---|
| 264 | <command>dnssec-signkey</command>,
|
---|
| 265 | <command>dnssec-keygen</command>,
|
---|
| 266 | <command>dnssec-makekeyset</command> and
|
---|
| 267 | <command>nsupdate</command>.</para>
|
---|
| 268 | </sect2>
|
---|
| 269 |
|
---|
| 270 | <sect2><title>Description</title>
|
---|
| 271 |
|
---|
| 272 | <sect3><title>dig</title>
|
---|
| 273 | <para><command>dig</command> interrogates <acronym>DNS</acronym>
|
---|
| 274 | servers.</para></sect3>
|
---|
| 275 |
|
---|
| 276 | <sect3><title>host</title>
|
---|
| 277 | <para><command>host</command> is a utility for <acronym>DNS</acronym>
|
---|
| 278 | lookups.</para></sect3>
|
---|
| 279 |
|
---|
| 280 | <sect3><title>nslookup</title>
|
---|
| 281 | <para><command>nslookup</command> is a program used to query Internet
|
---|
| 282 | domain nameservers.</para></sect3>
|
---|
| 283 |
|
---|
| 284 | <sect3><title>rndc</title>
|
---|
| 285 | <para><command>rndc</command> controls the operation of
|
---|
| 286 | <application><acronym>BIND</acronym></application>.</para></sect3>
|
---|
| 287 |
|
---|
| 288 | <sect3><title>rndc-confgen</title>
|
---|
| 289 | <para><command>rndc-confgen</command> generates
|
---|
| 290 | <filename>rndc.conf</filename> files.</para></sect3>
|
---|
| 291 |
|
---|
| 292 | <sect3><title>named-checkconf</title>
|
---|
| 293 | <para><command>named-checkconf</command> checks the syntax of
|
---|
| 294 | <filename>named.conf</filename> files.</para></sect3>
|
---|
| 295 |
|
---|
| 296 | <sect3><title>named-checkzone</title>
|
---|
| 297 | <para><command>named-checkzone</command> checks zone file
|
---|
| 298 | validity.</para></sect3>
|
---|
| 299 |
|
---|
| 300 | <sect3><title>lwresd</title>
|
---|
| 301 | <para><command>lwresd</command> is a caching-only name server for local
|
---|
| 302 | process use.</para></sect3>
|
---|
| 303 |
|
---|
| 304 | <sect3><title>named</title>
|
---|
| 305 | <para><command>named</command> is the name server daemon.</para></sect3>
|
---|
| 306 |
|
---|
| 307 | <sect3><title>dnssec-signzone</title>
|
---|
| 308 | <para><command>dnssec-signzone</command> generates signed versions of
|
---|
| 309 | zone files.</para></sect3>
|
---|
| 310 |
|
---|
| 311 | <sect3><title>dnssec-signkey</title>
|
---|
| 312 | <para><command>dnssec-signkey</command> signs zone file key
|
---|
| 313 | sets.</para></sect3>
|
---|
| 314 |
|
---|
| 315 | <sect3><title>dnssec-keygen</title>
|
---|
| 316 | <para><command>dnssec-keygen</command> is a key generator for secure
|
---|
| 317 | <acronym>DNS</acronym>.</para></sect3>
|
---|
| 318 |
|
---|
| 319 | <sect3><title>dnssec-makekeyset</title>
|
---|
| 320 | <para><command>dnssec-makekeyset</command> generates a key set from one
|
---|
| 321 | or more keys created by dnssec-keygen.</para></sect3>
|
---|
| 322 |
|
---|
| 323 | <sect3><title>nsupdate</title>
|
---|
| 324 | <para><command>nsupdate</command> is used to submit
|
---|
| 325 | <acronym>DNS</acronym> update requests.</para></sect3>
|
---|
| 326 |
|
---|
| 327 | </sect2>
|
---|
[f45b1953] | 328 |
|
---|
| 329 | </sect1>
|
---|
| 330 |
|
---|