我有一个运行在Ubuntu服务器上的绑定,我想用它来代替使用主机文件。 我很没经验,并且遇到很多麻烦。 现在绑定服务器正在为内部DNS工作,并且是之前的外部DNS服务器,但是已经从中退出。 我在这里跟着教程,一直没有得到它的工作。 在绑定的DNS条目有一个更简单的方法吗? 我主要为我的路由器运行clearOS,他们只需要一个简单的方法来添加主机名和IP地址。
所以我想要做的是采取主机名westappps.cable.comcast.com并指向它的IP 10.168.220.220。 有没有办法做到这一点,而不是为它做一个区域?
/etc/bind/named.conf.local // // Do any local configuration here // // Consider adding the 1918 zones here, if they are not used in your // organization //include "/etc/bind/zones.rfc1918"; include "/etc/bind/rndc.key"; view "internal" { match-clients { lan_hosts; }; recursion yes; // prime the server with knowledge of the root servers zone "." { type hint; file "/etc/bind/db.root"; }; // be authoritative for the localhost forward and reverse zones, and for // broadcast zones as per RFC 1912 zone "localhost" { type master; file "/etc/bind/db.local"; }; zone "127.in-addr.arpa" { type master; file "/etc/bind/db.127"; }; zone "0.in-addr.arpa" { type master; file "/etc/bind/db.0"; }; zone "255.in-addr.arpa" { type master; file "/etc/bind/db.255"; }; zone "trizonllc.com" { type master; file "/var/lib/bind/trizonllc.com.internal.hosts"; }; zone "gotrizon.com" { type master; file "/var/lib/bind/gotrizon.com.internal.hosts"; }; zone "trizon.com" { type master; file "/var/lib/bind/trizon.com.internal.hosts"; }; zone "8.168.192.in-addr.arpa" { type master; file "/var/lib/bind/db.192.168.8"; allow-update { key rndc-key; }; notify yes; }; zone "cable.comcast.com"{ type master; file "/var/lib/bind/cable.comcast.com.internal.hosts"; }; }; view "external" { match-clients { !lan_hosts; any; }; recursion no; // prime the server with knowledge of the root servers zone "." { type hint; file "/etc/bind/db.root"; }; zone "trizonllc.com" { type master; file "/var/lib/bind/trizonllc.com.hosts"; }; zone "spectraseven.com" { type master; file "/var/lib/bind/spectraseven.com.hosts"; }; zone "doelevate.com" { type master; file "/var/lib/bind/doelevate.com.hosts"; }; zone "frontiersalessupport.com" { type master; file "/var/lib/bind/frontiersalessupport.com.hosts"; }; zone "gotrizon.com" { type master; file "/var/lib/bind/gotrizon.com.hosts"; }; zone "trizon.com" { type master; file "/var/lib/bind/trizon.com.hosts"; }; zone "teltanium.com" { type master; file "/var/lib/bind/teltanium.com.hosts"; }; zone "transynergydirect.com" { type master; file "/var/lib/bind/transynergydirect.com.hosts"; }; zone "trizonstall.com" { type master; file "/var/lib/bind/trizonstall.com.hosts"; }; zone "czncorp.com" { type master; file "/var/lib/bind/czncorp.com.hosts"; }; zone "trizonllc.net" { type master; file "/var/lib/bind/trizonllc.net.hosts"; }; zone "spectraseven.net" { type master; file "/var/lib/bind/spectraseven.net.hosts"; }; zone "redrk.com" { type master; file "/var/lib/bind/redrk.com.hosts"; }; zone "redrocc.com" { type master; file "/var/lib/bind/redrocc.com.hosts"; }; zone "getredrock.com" { type master; file "/var/lib/bind/getredrock.com.hosts"; }; zone "maxguardid.com" { type master; file "/var/lib/bind/maxguardid.com.hosts"; }; zone "gotritech.com" { type master; file "/var/lib/bind/gotritech.com.external.hosts"; }; zone "cooleypro.com" { type master; file "/var/lib/bind/cooleypro.com.external.hosts"; }; zone "amerihomesgroup.com" { type master; file "/var/lib/bind/amerihomesgroup.com.hosts"; }; zone "cable.comcast.com"{ type master; file "/var/lib/bind/cable.comcast.com.hosts"; }; };
/var/lib/bin/cable.comcast.com.local
$ttl 3600 cable.comcast.com. IN SOA 69.252.81.81 ( 42 900 600 86400 3600 ) NS ns02.cable.comcast.com. A 10.0.0.123 westapps A 10.168.220.220
所以我想通了。 我使用命令named-checkzone example.com /etc/bind/db.example.com来检查我的文件,它给了我这些错误:
/var/lib/bind/cable.comcast.com.hosts:9: ignoring out-of-zone data (ns02) /var/lib/bind/cable.comcast.com.hosts:12: ignoring out-of-zone data (westapps) zone cable.comcast.com/IN: has no NS records zone cable.comcast.com/IN: not loaded due to errors.
要修复忽略区域外数据错误,我添加了每个FQDN并重新启动绑定。 我仍然没有使用Comcast设置的DNS服务器,但是这应该解决我的问题。 这是我完成的区域文件。
$ORIGIN . $ttl 3600 cable.comcast.com. IN SOA cable.comcast.com. admin.cable.comcast.com. ( 42 900 600 86400 3600 ) NS ns02.cable.comcast.com. ns02.cable.comcast.com. A 69.252.81.81 westapps.cable.comcast.com. A 10.168.220.220 erone.cable.comcast.com. A 10.165.55.140
我希望这可以帮助别人。