我使用以下文件创建了一个 DNS 服务器,将我的域地址映射sudia.com
到我的 VPS 服务器,但它不起作用,我无法使用我的域地址访问我的服务器。还必须说有一个 NginX 正在运行http://136.243.197.164:3200
。
/etc/named.conf:
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";
secroots-file "/var/named/data/named.secroots";
recursing-file "/var/named/data/named.recursing";
allow-query { localhost; 136.243.197.164;};
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
/* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
include "/etc/crypto-policies/back-ends/bind.config";
};
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";
//forward zone
zone "sudia.com" IN {
type master;
file "fwd.sudia.com.db";
allow-update { none; };
allow-query { any; };
};
//backward zone
zone "197.243.136.in-addr.arpa" IN {
type master;
file "sudia.com.rev";
allow-update { none; };
allow-query { any; };
};
/var/named/fwd.sudia.com.db:
$TTL 86400
@ IN SOA ns1.sudia.com. ns2.sudia.com. (
3 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
;Name Server Information
@ IN NS ns1.sudia.com.
;IP address of Name Server
ns1 IN A 136.243.197.164
;A - Record HostName To Ip Address
www IN A 136.243.197.164
;CNAME record
ftp IN CNAME www.sudsuz.com.
/var/named/sudia.com.rev:
$TTL 86400
@ IN SOA ns1.sudia.com. ns2.sudia.com. (
3 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
;Name Server Information
@ IN NS ns1.sudia.com.
;Reverse lookup for Name Server
164 IN PTR ns1.sudia.com.
;PTR Record IP address to HostName
164 IN PTR www.sudia.com
编辑:这是结果host www.sudia.com
:
www.sudia.com has address 136.243.197.164
但是host sudia.com
(没有www
)不起作用!
正如@DanielB 在评论中指出的那样,排除其他可能的问题,您似乎缺少裸域的 A 记录。这种类型的 A 记录的示例是:
因此,您的示例区域的更新版本可能是:
前任。var/named/fwd.sudia.com.db