DNS之缓存服务器部署流程
Posted liming-linux-python
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DNS之缓存服务器部署流程相关的知识,希望对你有一定的参考价值。
环境介绍
[[email protected] ~]# cat /etc/centos-release
CentOS release 6.6 (Final)
[[email protected] ~]# ifconfig eth0|sed -rn ‘s/.*dr:(.*) B.*/1/p‘
192.168.30.149
安装部署
[[email protected] ~]# yum install -y bind bind-libs bind-utils
[[email protected] ~]# cp /etc/named.conf{,.bak}
[[email protected] ~]# vim /etc/named.conf
options {
// listen-on port 53 { 127.0.0.1; }; # 或【listen-on port 53 { 192.168.30.149; 127.0.0.1; };】
// listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
// allow-query { localhost; }; # 或【allow-query { any; };】
recursion yes;
// dnssec-enable yes;
// dnssec-validation yes;
/* Path to ISC DLV key */
// bindkeys-file "/etc/named.iscdlv.key";
// managed-keys-directory "/var/named/dynamic";
};
[[email protected] ~]# named-checkconf
[[email protected] ~]# /etc/init.d/named start
[[email protected] ~]# ss -lntup4|grep named
略
客户端
[[email protected] ~]# cat /etc/centos-release
CentOS release 6.6 (Final)
[[email protected] ~]# ifconfig eth0
[[email protected] ~]# ifconfig eth0|sed -rn ‘s/.*dr:(.*) B.*/1/p‘
192.168.30.151
[[email protected] ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search localdomain
# nameserver 192.168.30.2
[[email protected] ~]# ping -c 1 baidu.com &>/dev/null && echo ok || echo false
false
[[email protected] ~]# echo "nameserver 192.168.30.149" >>/etc/resolv.conf
[[email protected] ~]# ping -c 1 baidu.com &>/dev/null && echo ok || echo false
ok
以上是关于DNS之缓存服务器部署流程的主要内容,如果未能解决你的问题,请参考以下文章