我想了解 DNS 和配置域。使用 cpanel 配置很简单,但我想使用 BIND 工具在服务器上配置。如何使用名称服务器绑定子域,例如测试域名.com
错误名称未解决
我从一家托管公司购买了一个域名。
ns1.xxxxx.com
ns2.xxxxx.com
文件内容:/etc/named.conf
options {
listen-on port 53 { any; };
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; };
recursion no;
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";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
zone "ns1.xxxxx.com" {type master;file "/var/named/ns1.xxxxx.com.db";};
zone "ns2.xxxxx.com" {type master;file "/var/named/ns2.xxxxx.com.db";};
文件内容:/var/named/ns1.xxxxx.com.db
$TTL 14400
ns1.xxxxx.com. 86400 IN SOA ns1.xxxxx.com. info.xxxx.com. (
2013071600 ;serial, todays date+todays
86400 ;refresh, seconds
7200 ;retry, seconds
3600000 ;expire, seconds
86400 ;minimum, seconds
)
ns1.xxxxx.com. 86400 IN NS ns1.xxxxx.com.
ns1.xxxxx.com. 86400 IN NS ns2.xxxxx.com.
ns1.xxxxx.com. 14400 IN A ipaddress
test 14400 IN A ipaddress
文件内容:/var/named/ns2.xxxxx.com.db
$TTL 14400
ns2.xxxxx.com. 86400 IN SOA ns1.xxxxx.com. info.xxxx.com. (
2013071600 ;serial, todays date+todays
86400 ;refresh, seconds
7200 ;retry, seconds
3600000 ;expire, seconds
86400 ;minimum, seconds
)
ns2.xxxxx.com. 86400 IN NS ns1.xxxxx.com.
ns2.xxxxx.com. 86400 IN NS ns2.xxxxx.com.
ns2.xxxxx.com. 14400 IN A ipaddress
test 14400 IN A ipaddress