我需要配置一个 contos7 DNS 服务器。我们需要使用 BIND。要检查服务器是否正常工作,我需要在地址 svr1.breda.ikdoeict 上 ping 我的 DNS 服务器。
这是 /var/named/breda.ikdoeict 的配置
@ IN SOA @ breda.ikdoeict. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS @
@ IN A 10.123.34.123
srv1 IN A 10.129.34.123
www IN CNAME srv1
这是 /etc/named.conf 的配置
options {
listen-on port 53 { 127.0.0.1;10.129.34.123; };
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 { localhost;10.129.32.0/21; };
forwarders { 10.129.28.230;10.129.28.232;};
recursion yes;
dnssec-enable no;
dnssec-validation no;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.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";
};
zone "breda.ikdoeict" IN{
type master;
file "breda.ikdoeict";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key"
在这里你可以看到我已将 DNS 添加到我的客户端
student@student-ubuntu:~$ nmcli device show ens160 | grep IP4.DNS
IP4.DNS[1]: 10.132.1.5
IP4.DNS[2]: 10.132.1.6
IP4.DNS[3]: 10.129.34.123
当我尝试 ping svr1.breda.ikdoeict 时,它显示未知主机。
答案1
检查您正在 ping 的客户端系统上的 resolv.conf 文件是否配置了合适的nameserver
指令,以及是否可以从您的客户端访问指定的名称服务器。