我有一台安装了CentOS 5.9 32位的OpenVZ VPS服务器。 我也从本地供应商(masterwebnet.com)购买域名sehattotal.com。 目前sehattotal.com托pipe在hostgator.com。
我的目的是在VPS服务器中创buildDNS服务器,并将我的域指向它。
所以我尝试在我的服务器中configurationBind9,如下所示:
/etc/named.conf文件:
options { 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"; allow-query { any; }; allow-transfer { localhost; 0.0.0.0; }; recursion no; dnssec-enable yes; dnssec-lookaside . trust-anchor dlv.isc.org.; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "." IN { type hint; file "named.root"; }; zone "localdomain." IN { type master; file "localdomain.zone"; allow-update { none; }; }; zone "localhost." IN { type master; file "localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa." IN { type master; file "named.local"; allow-update { none; }; }; zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." IN { type master; file "named.ip6.local"; allow-update { none; }; }; zone "255.in-addr.arpa." IN { type master; file "named.broadcast"; allow-update { none; }; }; zone "0.in-addr.arpa." IN { type master; file "named.zero"; allow-update { none; }; }; zone "sehattotal.com" IN { type master; file "sehattotal.com.zone"; allow-update { none; }; }; include "/etc/rndc.key";
/var/named/chroot/var/named/sehattotal.com.zone:
$TTL 86400 @ IN SOA ns1.sehattotal.com. root.sehattotal.com. ( 2013122901 ;Serial 21600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ) ;Minimum TTL @ IN NS ns1.sehattotal.com. ns1 IN A 116.251.208.167
当我尝试启动命名服务时没有错误。
问题是我认为这是行不通的,因为我不能ping ns1.sehattotal.com。
任何build议?
注意:目前sehattotal.com有NS2227.HOSTGATOR.COM和NS228.HOSTGATOR.COM我仍然不能改变它到NS1.SEHATTOTAL.COM,因为当我ping到NS1.SEHATTOTAL.COM它返回:
Ping请求找不到主机ns1.sehattotal.com。 请检查名称,然后重试。
您的提供者没有正确委派区域:
[me@risby tmp]$ whois sehattotal.com [Querying whois.verisign-grs.com] [Redirected to whois.tucows.com] [Querying whois.tucows.com] [whois.tucows.com] Domain Name: SEHATTOTAL.COM [...] Name Server: NS2227.HOSTGATOR.COM Name Server: NS2228.HOSTGATOR.COM
和
[root@bill ~]# dig NS2227.HOSTGATOR.COM [...] ;; ANSWER SECTION: NS2227.HOSTGATOR.COM. 43200 IN A 192.254.235.98 [...] [root@bill ~]# dig NS2228.HOSTGATOR.COM [...] ;; ANSWER SECTION: NS2228.HOSTGATOR.COM. 43200 IN A 192.254.235.99 [...]
由于这两个都不是你为ns1设置的IP地址,所以我认为这个委派是不正确的。
仅仅注册一个域名并设置一个域名服务器并不会神奇地将两者联系起来:世界必须被告知,当它查找域名时,它应该使用你的域名服务器(是的,需要两个,即使你只要列出相同的地址两次)。 这是您的注册商(在这种情况下,tucows)所提供的胶水。
我将这个问题看作是“ 没有显示任何研究工作 ”,但是你已经足够了,可以给出完整的域名和地址,并且在你的问题中没有任何含糊的内容。 谢谢你 – 这不会让他们更容易回答。
似乎你错过了反向DNS区域,
还要在resolve.conf文件中添加DNS服务器的IP地址
不要忘记在防火墙允许DNSstream量
iptables -A OUTPUT -p udp -o eth0 --dport 53 -j ACCEPT iptables -A INPUT -p udp -i eth0 --sport 53 -j ACCEPT
将eth0更改为监听ip的接口,或者仅用于testing目的,用来阻止防火墙
service iptables stop
然后启动指定的服务。
下面有一个很好的指导,你只需要设置主dns部分。
http://www.unixmen.com/dns-server-installation-step-by-step-using-centos-6-3/