BIND9配置.org域名支持DNSSEC

2011-02-06 05:09

.org的域名均已支持DNSSEC,本文部分内容借鉴网络,配置环境为Debian 5。
一:
安装好bind9之后:
编辑:/etc/bind/named.conf
在最后添加:


recursion no;


以关掉递归查询
添加好zone文件,见:/blog/201102051332.html


zone "zh-hant.org" {
type master;
file "db.zh-hant.org";
allow-transfer {从服务器IP地址; };
notify yes;
also-notify {从服务器IP地址; };
};


进入工作目录:


cd /etc/bind


运行:


named-checkzone zh-hant.org db.zh-hant.org


验查是否有语法错误
二:
运行命令一:


dnssec-keygen -r/dev/random -fKSK -aRSASHA1 -b2048 -nZONE zh-hant.org


片刻会在工作目录下生成类似:Kzh-hant.org.+005+30664.key
运行命令二:


dnssec-keygen -r/dev/random -aRSASHA1 -b1024 -nZONE zh-hant.org


片刻会在工作目录下生成类似:Kzh-hant.org.+005+61881.key
如果很长时间都没有生成,可将/dev/random换成/dev/urandom
编辑:db.zh-hant.org,在最后添加


$INCLUDE "Kzh-hant.org.+005+30664.key"
$INCLUDE "Kzh-hant.org.+005+61881.key"


然后对整个域进行签名,运行:


dnssec-signzone -r/dev/random -e+31104000
-ozh-hant.org -kKzh-hant.org.+005+30664
db.zh-hant.org Kzh-hant.org.+005+61881.key


运行后会生成:db.zh-hant.org.signed
然后编缉named.conf:


zone "zh-hant.org" {
type master;
file "db.zh-hant.org";
allow-transfer {从服务器IP地址; };
notify yes;
also-notify {从服务器IP地址; };
};


改为:


zone "zh-hant.org" {
type master;
file "db.zh-hant.org.signed";
allow-transfer {从服务器IP地址; };
notify yes;
also-notify {从服务器IP地址; };
};


检查语法是否错误:


named-checkzone zh-hant.org db.zh-hant.org.signed


成功后重载bind


/etc/init.d/bind9 reload


检查是否正常解析:


dig +dnssec @localhost db.zh-hant.org


查看工作目录中的:dsset-zh-hant.org.这个文件,提供给域名注册商,OK。


zh-hant.org. IN DS 30664 5 1 3E7095DD6827E29436C6A8284B4C1CCB7232277F
zh-hant.org. IN DS 30664 5 2 1CA6BFE64976238A315F4123B173D70CCE7B2AE6E7772C7AF4B92791 725BD70E


以godaddy为例,Manage DS Records >> Add new DS record


Key Tag 为:30664
Algorithm 为:5
Digest Type 为:1 - SHA-1
Max Signature Life (in seconds) 为:31104000
Digest 为:3E7095DD6827E29436C6A8284B4C1CCB7232277F


再添加:


Key Tag 为:30664
Algorithm 为:5
Digest Type 为:2 - SHA-256
Max Signature Life (in seconds) 为:31104000
Digest 为:1CA6BFE64976238A315F4123B173D70CCE7B2AE6E7772C7AF4B92791725BD70E


最后提交。
运行


whois zh-hant.org


查看是否显示:


DNSSEC:Signed


完成。
每次修改记录后,重新执行一次:


dnssec-signzone -r/dev/random -e+31104000
-ozh-hant.org -kKzh-hant.org.+005+30664
db.zh-hant.org Kzh-hant.org.+005+61881.key

 

0 条回复

说两句