我正在尝试在自己的 Web 服务器上设置一个域。我昨天让它正常工作,但现在每次访问网站时都会收到 504 错误。该网站是 www.emotorcyclefairings.com 。A 记录正确显示并由 ddclient 配置。此外,我正在使用 namecheap,因此我能够配置 DNS 服务器和主机记录。我还使用 Google 的公共 DNS 和 Bind9,因此我的服务器不必处理所有负载。我在这里做错了什么,因为我认为 DNS 解析不正确?
命名的.conf.本地
# This is the zone definition. replace example.com with your domain name
zone "emotorcyclefairings.com" {
type master;
file "/etc/bind/zones/example.com.db";
};
# This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.1.168.192.in-addr.arpa";
};
命名的.conf.选项
forwarders {
# Replace the address below with the address of your provider's DNS server
8.8.8.8;
8.8.4.4;
};
emotorcyclefarings.com.db
// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
example.com. IN SOA ns1.emotorcyclefairings.com. ns2.emotorcyclefairings.com. (
// Do not modify the following lines!
2006081401
28800
3600
604800
38400
)
// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
emotorcyclefairings.com. IN NS ns1.emotorcyclefairings.com.
emotorcyclefairings.com. IN NS ns2.emotorcyclefairings.com.
// Replace the IP address with the right IP addresses.
www IN A 192.168.1.8
@ IN A 192.168.1.8
ns1 IN A 8.8.8.8
ns2 IN A 8.8.4.4
rev.1.168.192.in-addr.arpa
//replace example.com with yoour domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1.
@ IN SOA ns1.emotorcyclefairings.com. ns2.emotorcyclefairings.com. (
2006081401;
28800;
604800;
604800;
86400
)
IN NS ns1.emotorcyclefairings.com.
IN NS ns2.emotorcyclefairings.com.
8 IN PTR emotorcyclefairings.com
答案1
首先,您需要删除示例信息并重新开始。其次,如果这听起来太令人畏惧,请退后一步,重新阅读 DNS 和 BIND,然后再回来。
- 首先,您在区域定义下列出了示例数据库文件,然后列出了摩托车文件的内容。
- 您的 SOA 记录有误。
- 您列出了私有 IP 地址,这对于内部区域来说没问题,但对于面向公众的 DNS 来说却不正确。
- 您已将 Google 的 DNS 列为您的 ns1。这不会给您带来任何好处。