您好,登录后才能下订单哦!
这篇文章主要介绍“怎么建立slave类型的dns服务器”,在日常操作中,相信很多人在怎么建立slave类型的dns服务器问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么建立slave类型的dns服务器”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
DNS服务器的类型:
Master: 提供dns服务,并且本身含有区域文档。
Slave: 和Master一起提供dns服务,当Master服务器上的名字地址对更改的时候,会自动更新Slave服务器来达到同步。
Cache-only: 没有自己的区域文档,只是帮助客户段向外部dns请求查询,然后将查到的结果保存到他的缓存中。
[@more@]
1,pre-configuration check
dig -t axfr example.com @192.168.0.254
host -l example.com 192.168.0.254
2,安装包
yum install -y bind bind-utils bind-chroot caching-nameserver
3,编辑named.conf
zone "example.com" IN {
type slave;
masters { 192.168.0.254; };
file "slaves/example.com.zone";
forwarders {};
};
4, 修改文件权限
[root@station10 etc]# ls -lZ
-rw-r--r-- root root system_u:object_r:locale_t localtime
-rw-r----- root named system_u:object_r:named_conf_t named.caching-nameserver.conf
-rw-r----- root root root:object_r:named_conf_t named.conf
-rw-r----- root named system_u:object_r:named_conf_t named.rfc1912.zones
-rw-r--r-- root named system_u:object_r:dnssec_t rndc.key
[root@station10 etc]# chown root:named named.conf
[root@station10 etc]# chmod 640 !$
chmod 640 named.conf
[root@station10 etc]# ls -lZ
-rw-r--r-- root root system_u:object_r:locale_t localtime
-rw-r----- root named system_u:object_r:named_conf_t named.caching-nameserver.conf
-rw-r----- root named root:object_r:named_conf_t named.conf
-rw-r----- root named system_u:object_r:named_conf_t named.rfc1912.zones
-rw-r--r-- root named system_u:object_r:dnssec_t rndc.key
[root@station10 etc]#
5,启动服务
[root@station10 etc]# service named configtest
zone localdomain/IN: loaded serial 42
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700
zone 255.in-addr.arpa/IN: loaded serial 42
zone 0.in-addr.arpa/IN: loaded serial 42
[root@station10 etc]# service named restart
6,查看产生的文件
[root@station10 etc]# cd /var/named/chroot/var/named/slaves/
[root@station10 slaves]# ls -lZ
-rw-r--r-- named named root:object_r:named_cache_t example.com.zone
[root@station10 slaves]# cat example.com.zone
7,测试
[root@station10 slaves]# host -r station10.example.com localhost
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases:
station10.example.com has address 192.168.0.10
[root@station10 slaves]# dig +norecurse station10.example.com @localhost
; <<>> DiG 9.3.3rc2 <<>> +norecurse station10.example.com @localhost
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11983
;; flags: qr aa ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;station10.example.com. IN A
;; ANSWER SECTION:
station10.example.com. 86400 IN A 192.168.0.10
;; AUTHORITY SECTION:
example.com. 86400 IN NS server1.example.com.
;; ADDITIONAL SECTION:
server1.example.com. 86400 IN A 192.168.0.254
;; Query time: 14 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 10 00:55:54 2008
;; MSG SIZE rcvd: 93
[root@station10 slaves]#
到此,关于“怎么建立slave类型的dns服务器”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。