安装

yum install bind* -y

rndc-confgen -r /dev/urandom -a


vim /etc/named.conf

options {

version “1.1.1″;

listen-on port 53 {any;};

directory “/var/named/chroot/etc/”;

pid-file “/var/named/chroot/var/run/named/named.pid”;

allow-query { any; };

Dump-file “/var/named/chroot/var/log/binddump.db”;

Statistics-file “/var/named/chroot/var/log/named_stats”;

zone-statistics yes;

memstatistics-file “log/mem_stats”;

empty-zones-enable no;

# allow-update {none;};

# allow-recursion {any;};

# serial-query-rate 100;

# recursion no;

# dnssec-enable yes;

};


key “rndc-key” {

algorithm hmac-md5;

secret “Eqw4hClGExUWeDkKBX/pBg==”;

};


controls {

inet 127.0.0.1 port 953

allow { 127.0.0.1; } keys { “rndc-key”; };

};


logging {

channel warning {

file “/var/named/chroot/var/log/dns_warning” versions 10 size 10m;

severity warning;

print-category yes;

print-severity yes;

print-time yes;

};

channel general_dns {

file “/var/named/chroot/var/log/dns_log” versions 10 size 10m;

severity info;

print-category yes;

print-severity yes;

print-time yes;

};

category default {

warning;

};

category queries {

general_dns;

};

};


include “/var/named/chroot/etc/view.conf”;


vim /etc/rndc.key

key “rndc-key” {

algorithm hmac-md5;

secret “Eqw4hClGExUWeDkKBX/pBg==”;

};

vim /etc/rndc.conf

# Start of rndc.conf

key “rndc-key” {

algorithm hmac-md5;

secret “Eqw4hClGExUWeDkKBX/pBg==”;

};


options {

default-key “rndc-key”;

default-server 127.0.0.1;

default-port 953;

};

vim /var/named/chroot/etc/view.conf

view “View” {

allow-transfer {

#dns-ip-list;

};

notify yes;

also-notify {

#dns-ip-list;

};

# ixfr-from-differences yes;

zone “com” {

type master;

file “com.zone”;

allow-transfer {

10.255.253.211;

};

notify yes;

also-notify {

10.255.253.211;

};

};

};

vim /var/named/chroot/etc/com.zone

$ORIGIN .

$TTL 3600 ; 1 hour

com IN SOA dns246. hostmaster. (

2000 ; serial

900 ; refresh (15 minutes)

600 ; retry (10 minutes)

86400 ; expire (1 day)

3600 ; minimum (1 hour)

)

NS dns246.

$ORIGIN com.

dangdang A 192.168.224.64

启动

/etc/init.d/named start