架设dns服务器 on redhat enterprise as 4.4

1:down
www.isc.org
tar zxvf bind-9.4.0.tar.gz
2:install
cd bind-*
./configure --prefix=/site/named --enable-threads
make;make install
mkdir /var/named
3:config
 cd /site/named
 sbin/rndc-confgen -a
 将生成所需要的key在当前目录的 etc下
  vi etc/named.conf
  options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
};
include "/site/named/etc/rndc.key";
controls {
inet 127.0.0.1 allow {localhost;} keys { rndckey; };
};
zone "." IN {
type hint;
file "named.root";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

//add new content
zone "test.net" IN {
type master;
file "test.net.zone";
};

zone "0.0.127.in-addr.arpa" IN{
type master;
file "named.local";
allow-update { none; };
};

//new content
zone "0.168.192.in-addr.arpa" IN {
type master;
file "test.local";
};
/*******************
cd /var/named
 dig > named.root
 vi localhost.zone
$TTL 86400
$ORIGIN localhost.
@       1D IN SOA       @ root (
                42              ; serial (d. adams)
                3H              ; refresh
                15M             ; retry
                1W              ; expiry
                1D )            ; minimum

        1D IN NS        @
        1D IN A         127.0.0.1

vi test.net.zone
$TTL 86400
@ IN SOA www.test.net. master.test.net. (
 2; serial
 28800;refresh
 7200; retry
 604800; exprie
 86400;ttl
 )
 IN NS  www.test.net.
 IN MX 5 mail.test.net.
localhost. IN A 127.0.0.1
ssl IN A 192.168.0.72
www IN A 192.168.0.72
ftp IN A 192.168.0.72
mail IN A 192.168.0.72

vi named.local
$TTL 86400
@ IN SOA www.test.net. root.ns.test.net. (
 20070412; Serial
 28800 ; Refresh
 14400 ; Retry
 3600000 ; Expire
 86400 ) ; Minimum

 IN NS www.test.net.
1 IN PTR www.test.net.
 

vi test.local
$TTL 86400
@ IN SOA test.net. root.test.net.(
 20070412;
 7200;
 3600;
 43200;
 86400);
@ IN NS    www.test.net.
@ IN MX 10 mail.test.net.
72.0.168.192.in-addr.arpa. IN PTR www.test.net.
72.0.168.192.in-addr.arpa. IN PTR mail.test.net.
72.0.168.192.in-addr.arpa. IN PTR ftp.test.net.
/**********************************/
4:check
  cd /site/namd
   sbin/named-checkconf etc/named.conf
   -------check named.conf是否有 语法错误
   -----

你可能感兴趣的:(redhat,ssl,File,include,SOA,DNS服务器)