dnspod-sr 是一个运行在 Linux 平台上的高性能的递归 DNS 服务器软件,强烈公司内网或者服务器内网使用dnspod-sr,具备高性能、高负载、易扩展的优势,非BIND、powerdns 等软件可以比拟。
项目地址:https://github.com/DNSPod/dnspod-sr
官网:dnspod-sr架构详解
2.公司、学校、政府等组织内部 DNS,解析外部不可见的私有域名,提高上网速度
集群式部署:
DNSPOD-SR说明文档里面提到支持集群,也没看出怎么支持集群,如果你想实现集群,同步root.z文件,前端可以用lvs、haproxy、keepalived等等来实现集群,方法很多.
dnspod-sr安装使用
1.安装
wget https://github.com/DNSPod/dnspod-sr/zipball/master
unzip master
cd DNSPod-dnspod-sr-c464043/
cd src/
make
2.配置
如果你仅仅需要一个dns转发器,那么什么都不需要配置,直接可以使用。但是如果你想解析自己的域名。修改dnspod-sr上层目录的root.z,在文件末尾添加
test.com. 3600 IN NS ns1.test.com. test.com. 3600 IN NS ns2.test.com. ns1.test.com. 3600 IN A 192.168.110.71 ns2.test.com. 3600 IN A 192.168.110.713.启动
启动报如下错误:
# ./dnspod-sr set affinity fetcher failed, may be the cpu cores num less than (FETCHER_NUM + QUIZZER_NUM + 1) set affinity quizzer failed, may be the cpu cores num less than (FETCHER_NUM + QUIZZER_NUM + 1) set affinity quizzer failed, may be the cpu cores num less than (FETCHER_NUM + QUIZZER_NUM + 1) [DBG:] dnspod-sr is successful running now!! [DBG:] max_ele_size is 1000000 - 1808 [DBG:] server may contain 332730 useful records [DBG:] hash_table_size is 65536 [DBG:] we have 10 hash tables [DBG:] we have 2 fetchers,2 quizzers dnspod-sr: author.c:438: release_qoutinfo: Assertion `val == (void *)mbuf' failed.CPU配置太低,换一台机器就可以了。
# dig @192.168.110.71 test.com NS ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5 <<>> @192.168.110.71 test.com NS ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50261 ;; flags: qr ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;test.com. IN NS ;; ANSWER SECTION: test.com. 3577 IN NS ns1.test.com. test.com. 3577 IN NS ns2.test.com. ;; Query time: 3 msec ;; SERVER: 192.168.110.71#53(192.168.110.71) ;; WHEN: Thu Apr 23 18:38:34 2015 ;; MSG SIZE rcvd: 62 # dig @192.168.110.71 ns1.test.com A ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5 <<>> @192.168.110.71 ns1.test.com A ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38915 ;; flags: qr ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;ns1.test.com. IN A ;; ANSWER SECTION: ns1.test.com. 3565 IN A 192.168.110.71 ;; Query time: 2 msec ;; SERVER: 192.168.110.71#53(192.168.110.71) ;; WHEN: Thu Apr 23 18:38:46 2015 ;; MSG SIZE rcvd: 46注:root.z的最后一行一定要一个空行,否则最后一条记录解析不到。
xfer: googleusercontent.com.:8.8.8.8 google.com.:8.8.8.8 itil.com.:10.6.18.41 facebook.com.:8.8.8.8 twitter.com.:8.8.8.8 flickr.com.:8.8.8.8 akamaiedge.net.:202.106.0.20 edgekey.net.:202.106.0.20 youtube.com.:8.8.8.8 s-static.ak.facebook.com.edgekey.net.:8.8.8.8 :最后一行以`:`结束。以上的几个域名解析请求都会中转到8.8.8.8上。
log_path: ../log/注:如果只是在内网做转发服务,dnspod-sr值得推荐,配置简单,集群搭建也简单。相比bind等等要简单很多,但是功能也简单。