.localhost. (
2011112401
3H
15M
1W
1D)
IN NS localhost.
1 IN PTR localhost.
chown :named localhost.zone named.*
named-checkconf 检查主配置文件
named-checkzone 检查区域文件
named-checkzone "localhost" localhost.zone
service named start启动服务
tail /var/log/messages,查看日志看是否有错误
vim /etc/named.conf
编辑正向解析和反向解析
zone "ting.com" IN {
type master;
file "ting.com.zone";
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file 192.168.0.local";
};
cd /var/named
vim ting.com.zone
$TTl 600
$ORIGIN ting.com.
@ IN SOA nsl.ting.com. admin.ting.com.(
2011112401
1H
10M
7D
1D)
IN NS nsl
IN NS ns2
IN MX 10 mail
IN MX 20 mail2
ns1 IN A 192.168.0.181
ns2 IN A 192.168.0.182
mail IN A 192.168.0.181
mail2 IN A 192.168.0.182
www IN A 192.168.0.181
ftp IN A 192.168.0.181
www2 IN CNAME www
cp ting.com.zone 192.168.0.local
vim 192.168.0.local 修改内容
$TTl 600
$ORIGIN ting.com.
@ IN SOA nsl.ting.com. admin.ting.com.(
2011112401
1H
10M
7D
1D)
IN NS nsl
IN NS ns2
IN MX 10 mail
IN MX 20 mail2
181 IN PTR ns1
182 IN PTR ns2
181 IN PTR mail
182 IN PTR mail2
181 IN PTR www
181 IN PTR ftp
chmod o-r ting.com.zone 192.168.0.local
chgrp named ting.com.zone 192.168.0.local
named-checkconf 检查主配置文件
named-checkzone 检查区域文件
service named restart
tail /var/log/messages
关闭selinux
setenforce 0
rndc是 dns远程配置工具
rndc flush 清空linux的dns 缓存
rndc status 查看DNS的区域
rndc reload 重新读取配置文件
rndc trace 2 调试第二个进程
rndc stop 停止服务
rndc notrace 停止调试
rndc freeze zone 让某个区域不能工作
retransfer 重传某个区域
配置从服务器
和创建主服务器一样
rndc-confgen > /etc/rndc.conf
cat !$
把key "rndckey"{
algorithm hmac-md5;
secret "uAgAJYS FB3xvAWoVxctGQ==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
复制到/etc/named.conf配置文件中
vim /etc/named.conf
编写options {
directory "/var/named";
querylog yes;启动日志
version "hh";
本文出自 “linux” 博客,请务必保留此出处http://3861645.blog.51cto.com/3851645/724442
|