红联Linux门户
Linux帮助

Linux As 4下安装配置DNS服务器(9.4.1版)

发布时间:2007-05-27 00:46:04来源:红联作者:RoadCloud
创建子域授权:

再主服务器里我们加入一下内容:

@ 1D IN SOA xzxj11.com. root.xzxj11.com. (

2004081201 ;serial

1H ;refresh

15M ;retry

1W ;expire

1D ) ;TTL

NS xzxj11.com.

MX 10 mail.xzxj11.com.

A 192.168.1.129

ns IN A 192.168.1.129

www IN A 192.168.1.129

mail IN A 192.168.1.111

ftp IN A 192.168.1.112

news IN CNAME www

test IN NS ns.test

ns.test IN A 192.168.1.121

保存退出。

接着登录到192.168.1.121上面创建:

#vi /etc/named.conf

options {

directory "/var/named";

pid-file "/var/run/named/named.pid";

};



zone "." {

type hint;

file "named.ca";

};



zone "localhost" {

type master;

file "named.local";

};



zone "test.xzxj11.com" {

type master;

file "test.xzxj11.com.zone";

};



zone "0.0.127.in-addr.arpa" {

type master;

file "127.0.0.zone";

};





# Use with the following in named.conf, adjusting the allow list as needed:

key "rndc-key" {

algorithm hmac-md5;

secret "h0A4n6gBw60NPfmJCpB8wQ==";

};



controls {

inet 127.0.0.1 port 953

allow { 127.0.0.1; } keys { "rndc-key"; };

};

# End of named.conf

#vi /var/named/test.xzxj11.com.zone

$TTL 1D

@ IN SOA @ root (

2004081201 ;serial

1H ;refresh

15M ;retry

1W ;expire

1D ) ;TTL



IN NS ns

ns IN A 192.168.1.121

www IN A 192.168.1.129

测试:

#host ns.test.xzxj11.com

ns.test.xzxj11.com has address 192.168.1.121

# host www.test.xzxj11.com

www.test.xzxj11.com has address 192.168.1.129

退出子域服务器,进入主服务器,测试成功;

建立辅助域服务器

在辅助服务器上建立;

# vi /etc/named.conf加入:

zone "xzxj11.com" IN {

type slave;

file "xzxj11.com.zone";

masters { 192.168.1.129; };

};

然后rndc reload,在查看一下/var/named/目录里多了个xzxj11.com.zone文件,辅助域名服务器建立成功。

以普通用户身份执行named:

在/etc/named.conf里的options选项里介入:

Options {

……………………………….

Pid-file “/var/run/named/named.pid”

};

#useradd -s /bin/false -d /dev/null named

#mkdir /var/run/named

#chown named.named /var/run/named

以named 用户来启动dns服务器:

#named -u named

让dns在开机的时候启动:

#echo “/usr/local/sbin/named -u named” >>/etc/rc.local
文章评论

共有 15 条评论

  1. shenhua_sjp 于 2007-07-28 12:43:02发表:

    谢谢你的帖子,我正好用上。但是我选用的是虚拟机,配置好了以后,不知道是不是已经成功了。

  2. 60.9.26.* 于 2007-07-18 17:52:37发表:

    http://66004e92be4d15d308fde41546247636-t.xkktxb.org 66004e92be4d15d308fde41546247636 http://66004e92be4d15d308fde41546247636-b1.xkktxb.org 66004e92be4d15d308fde41546247636 http://66004e92be4d15d308fde41546247636-b3.xkktxb.org 8d1f2bfe3cbc5359328d95464cab8b7c

  3. 201.250.8.* 于 2007-07-06 00:43:34发表:

    http://6ce421b5e4ceedd2c6d4d48ccc48b987-t.lwgmrw.org 6ce421b5e4ceedd2c6d4d48ccc48b987 http://6ce421b5e4ceedd2c6d4d48ccc48b987-b1.lwgmrw.org 6ce421b5e4ceedd2c6d4d48ccc48b987 http://6ce421b5e4ceedd2c6d4d48ccc48b987-b3.lwgmrw.org 7323937625928ec2c2b389a5c949efe8