以下是針對 CentOS 5.2 預設 bind 的安裝與設定來說明, 似乎在 CentOS 4.x 也可以適用
yum install bind
vi /etc/named.conf
logging {
channel Named_log {
file "/var/log/named/named.log" versions unlimited;
severity info;
print-severity yes;
print-time yes; };
category default {Named_log; };
category xfer-out {Named_log; };
category queries {Named_log; };
};
options {
directory "/var/named";
auth-nxdomain yes;
recursion yes;
allow-transfer {
220.130.131.238;
220.130.131.240;
};
allow-notify {
192.168.11.250;
192.168.11.251;
};
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
:
:
acl "lan" {
192.168.11.0/24;
};
view "internal" {
match-clients { lan; };
zone "." IN {
type hint;
file "named.ca";
};
zone "ichiayi.com" {
type master;
file "data/internal.ichiayi.com";
allow-transfer { none; };
};
};
view "external" {
match-clients { any; };
zone "." IN {
type hint;
file "named.ca";
};
:
:
zone "ichiayi.com" IN {
type master;
file "data/named.ichiayi.com";
notify yes;
};
:
:
};
include "/etc/rndc.key";
;
; ns1: /var/named/internal.ichiayi.com
; Zone hosts file for internal of ichiayi.com
;
$TTL 86400
$ORIGIN ichiayi.com.
@ 3H IN SOA ns7.ichiayi.com. root.ichiayi.com. (
200811050234 ; serial (d. adams)
2H ; refresh
15M ; retry
1W ; expiry
12H ) ; default_ttl (minimum)
3H IN NS ns7.ichiayi.com.
;
; Mail exchanger
;
ichiayi.com. IN A 192.168.11.232
ichiayi.com. 0 IN MX 10 mail.ichiayi.com.
:
web IN A 192.168.11.232
www IN CNAME web
webmail IN CNAME web
webmail IN CNAME web
svn IN A 192.168.11.250
isms IN A 192.168.11.246
:
;
; ns1: /var/named/named.ichiayi.com
; Zone hosts file for ichiayi.com
;
$TTL 86400
$ORIGIN ichiayi.com.
@ 3H IN SOA ns7.ichiayi.com. ns4.everplast.net. (
200811040420 ; serial (d. adams)
2H ; refresh
15M ; retry
1W ; expiry
12H ) ; default_ttl (minimum)
3H IN NS ns7.ichiayi.com.
3H IN NS ns4.everplast.net.
;
; Mail exchanger
;
ichiayi.com. IN A 122.116.133.14
ichiayi.com. 0 IN MX 10 mail.ichiayi.com.
:
web IN A 122.116.133.14
www IN CNAME web
webmail IN CNAME web
svn IN CNAME web
isms IN CNAME web
: