- #!/bin/bash
- rm -rf /etc/yum.repos.d/*.repo
- wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo -O /etc/yum.repos.d/CentOS-Base.repo
- yum -y install openssl-devel
- cd /usr/local/src
- wget http://ftp.isc.org/isc/bind9/9.6.2-P2/bind-9.6.2-P2.tar.gz
- tar -zxvf bind-9.6.2-P2.tar.gz
- cd bind-9.6.2-P2
- ./configure --enable-largefile --enable-threads --prefix=/usr/local/named
- make
- make install
- cd /usr/local/named/etc
- /usr/local/named/sbin/rndc-confgen > /usr/local/named/etc/rndc.conf
- tail -n10 rndc.conf |head -n9 |sed -e s/#\//g > named.conf
- mkdir -p /usr/local/named/data
- cd /usr/local/named/
- wget ftp://ftp.rs.internic.net/domain/named.root
- exit 1
- options {
- directory "/usr/local/named";
- pid-file "named.pid";
- listen-on port 53 {any;};
- allow-query {any;};
- dump-file "/usr/local/named/data/cache_dump.db";
- statistics-file "/usr/local/named/data/named_stats.txt";
- };
- key "rndc-key" {
- algorithm hmac-md5;
- secret "jhdbq+u4cE6KJdrJ6m6yAA==";
- };
- controls {
- inet 127.0.0.1 port 953
- allow { 127.0.0.1; } keys { "rndc-key"; };
- };
- zone "." IN {
- type hint;
- file "named.root";
- };
- zone "localhost" IN {
- type master;
- file "localhost.zone";
- allow-update { none; };
- };
- zone "0.0.127.in-addr.arpa" IN {
- type master;
- file "localhost.rev";
- allow-update { none; };
- };
- zone "3gwlan.com" IN {
- type master;
- file "3gwlan.com.zone";
- allow-update { none; };
- };
- zone "64.168.192.in-addr.arpa" IN {
- type master;
- file "192.168.64.zone";
- allow-update { none; };
- };
- $TTL 3600
- @ IN SOA @ root (
- 20100923 ;serial (d. adams)
- 3H ;refresh
- 15M ;retry
- 1W ;expiry
- 3600) ;minimum
- IN NS @
- IN A 127.0.0.1
- $TTL 3600
- @ IN SOA localhost. root.localhost. (
- 20100923 ; serial
- 3600 ; refresh every hour
- 900 ; retry every 15 minutes
- 3600000 ; expire 1000 hours
- 3600) ; minimun 1 hour
- IN NS localhost.
- 1 IN PTR localhost.
$TTL 86400
- @ IN SOA dns.3gwlan.com. root.3gwlan.com. (
- 420000 ; serial (d. adams)
- 3H ; refresh
- 15M ; retry
- 1W ; expiry
- 1D ) ; minimum
- IN NS dns.3gwlan.com.
- dns IN A 192.168.64.131
- www IN A 192.168.64.128
- 3gwlan.com. IN MX 5 mail.3gwlan.com.
- bbs IN CNAME www
- mail IN A 192.168.64.130
- $TTL 86400
- @ IN SOA dns.3gwlan.com. root.3gwlan.com. (
- 1997022700 ; serial (d. adams)
- 28800 ; refresh
- 14400 ; retry
- 3600000 ; expiry
- 86400) ; minimum
- IN NS dns.3gwlan.com.
- 130 IN PTR dns.3gwlan.com.
- 128 IN PTR www.3gwlan.com.
- 130 IN PTR mail.3gwlan.com.
- /usr/local/named/sbin/named -gc /usr/local/named/etc/named.conf &
- ; generated by /sbin/dhclient-script
- search localdomain
- nameserver 192.168.64.130
- www.3gwlan.com has address 192.168.64.128
- 128.64.168.192.in-addr.arpa domain name pointer www.3gwlan.com.
- 3gwlan.com name server dns.3gwlan.com.
- 3gwlan.com has SOA record dns.3gwlan.com. root.3gwlan.com. 420000 10800 900 604800 86400
- 3gwlan.com mail is handled by 5 mail.3gwlan.com.
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- Name: www.3gwlan.com
- Address: 192.168.64.128
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- 128.64.168.192.in-addr.arpa name = www.3gwlan.com.
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- bbs.3gwlan.com canonical name = www.3gwlan.com.
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- 3gwlan.com
- origin = dns.3gwlan.com
- mail addr = root.3gwlan.com
- serial = 420000
- refresh = 10800
- retry = 900
- expire = 604800
- minimum = 86400
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- 3gwlan.com mail exchanger = 5 mail.3gwlan.com.
- > set type=NS
- > 3gwlan.com
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- 3gwlan.com nameserver = dns.3gwlan.com.
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- 3gwlan.com nameserver = dns.3gwlan.com.
- > set type=MX
- > 3gwlan.com
- Server: 192.168.64.130
- Address: 192.168.64.130#53
- 3gwlan.com mail exchanger = 5 mail.3gwlan.com.
配置文件打包见附件