bind:服务器
bind-utils:客户端(测试用)
配置文件:/etc/named.conf
客户端测试工具:/usr/bin/dig
-
/usr/bin/host
-
/usr/bin/nslookup
安装
yum -y install bind bind-utils
启动服务
systemctl start named
现在已经能够为自己提供dns服务了
为别的主机提供服务需修改配置文件
修改配置文件
vim /etc/named.conf
options {
listen-on port 53 { localhost; }; #此处改为localhost 侦听的地址 或者注释掉或者删掉
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";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { any; }; #此处改为any ,是允许所有主机来访问
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.root.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca"; #named.ca 是根地址
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
配置文件相关
在配置zone的type时,有三种类型:
- hint:用来配置
.
的域名配置 - master:主服务器
- slave:从服务器
重新加载配置
rndc reload
此时别的主机就能访问本机DNS服务了
标签:named,DNS,bind,etc,file,var,软件,data From: https://www.cnblogs.com/guangdelw/p/17300859.html