インストール

[root@centos ~]# yum -y install bind bind-chroot caching-nameserver

設定

[root@centos ~]# cp -a /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/named.conf
[root@centos ~]# vim /var/named/chroot/etc/named.conf

options {
	listen-on port 53 { 127.0.0.1; 192.168.10.100; };
	directory "/var/named";
	dump-file "/var/named/data/cache_dump.db";
	statistics-file "/var/named/data/named_stats.txt";
	memstatistics-file "/var/named/data/named_mem_stats.txt";
	allow-query { 127.0.0.1; 192.168.10.0/24; };
	forwarders { 192.168.10.200; };
	version "";
};
logging {
	channel default_debug {
		file "data/named.run";
		severity dynamic;
	};
};
view localhost_resolver {
	match-clients { 127.0.0.1; };
	match-destinations { 127.0.0.1; };
	recursion yes;
	include "/etc/named.rfc1912.zones";
	include "/etc/named.si1230.com.zones";
};
view internal {
	match-clients { 192.168.10.0/24; };
	match-destinations { 192.168.10.100; };
	recursion yes;
	include "/etc/named.rfc1912.zones";
	include "/etc/named.si1230.com.zones";
};
[root@centos ~]# vim /var/named/chroot/etc/named.si1230.com.zones

zone "si1230.com" IN {
	type master;
	file "si1230.com.zone";
	allow-update { none; };
	allow-transfer { none; };
	notify no;
};
zone "1.168.192.in-addr.arpa" {
	type master;
	file "1.168.192.in-addr.arpa";
	allow-update { none; };
	allow-transfer { none; };
	notify no;
};
[root@centos ~]# chgrp named /var/named/chroot/etc/named.si1230.com.zones
[root@centos ~]# vim /var/named/chroot/var/named/si1230.com.zone

$TTL	172800
@	IN	SOA	server.si1230.com.	root.server.si1230.com. (
			2011062801
			3600
			300
			360000
			86400
			)

	IN	NS	server.si1230.com.

	IN	MX 10	server.si1230.com.

server	IN	A	192.168.10.100

www	IN	CNAME	server

[root@centos ~]# chgrp named /var/named/chroot/var/named/si1230.com.zone
[root@centos ~]# vim /var/named/chroot/var/named/10.168.192.in-addr.arpa

$TTL	172800
@	IN	SOA	server.si1230.com.	root.server.si1230.com. (
			2011062801
			3600
			300
			360000
			86400
			)

	IN	NS	server.si1230.com.

	IN	A	255.255.255.0

	IN	PTR	si1230.com.
100	IN	PTR	server.si1230.com.

[root@centos ~]# chgrp named /var/named/chroot/var/named/10.168.192.in-addr.arp

サービス有効化

[root@centos ~]# service named start
[root@centos ~]# chkconfig named on && chkconfig named --list

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)