- 论坛徽章:
- 0
|
根据这篇文章 http://www.freebsdchina.org/forum/viewtopic.php?p=160081#160081 进行架构根据电信、网通用户自动解析不同IP的DNS服务器。但碰到问题。
系统6.0 ,bind-9.3.2 主机名:ns.wzyako.net环境是这样的:局域网NAT下;IP:192.168.1.237 DNS:61.153.177.196;单网卡 想做成一台DNS服务器。同时内网有台对外的web服务器。想自动解析双线。我完全按照文章做了但还是失败。帖出信息,请各位朋友帮忙察看一下。谢谢
/etc/namedb/named.conf
options {
directory "/etc/namedb";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
// If named is being used only as a local resolver, this is a safe default.
// For named to be accessible to the network, comment this option, specify
// the proper IP address, or delete this option.
listen-on { 192.168.1.237; };
// forward only;
// If you've got a DNS server around at your upstream provider, enter
// its IP address here, and enable the line below. This will make you
// benefit from its cache, thus reduce overall DNS traffic in the Internet.
/*
forwarders {
61.153.177.196;
};
*/
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND versions 8 and later
* use a pseudo-random unprivileged UDP port by default.
*/
// query-source address * port 53;
};
// If you enable a local name server, don't forget to enter 127.0.0.1
// first in your /etc/resolv.conf so this server will be queried.
// Also, make sure to enable it in /etc/rc.conf.
key "rndc-key" {
algorithm hmac-md5;
secret "uAgemAhTp+V62QtswX092g==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
//add cnc acl by naizhao
acl "CNC" {
58.16.0.0/16;
........ (省略IP,太长)
222.163.128.0/17;
};
//view add by naizhao
view "view_cnc" {
match-clients { CNC; };
zone "." {
type hint;
file "named.root";
};
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "master/localhost.rev";
};
include "master/cnc.def";
};
view "view_any" {
match-clients { any; };
zone "." {
type hint;
file "named.root";
};
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "master/localhost.rev";
};
include "master/telecom.def";
};
因为6.0的localhost.rev是自动生成在/etc/namedb/master/下的,所以我自己改了一下file "master/localhost.rev" <====这里跟原文不同,但应该没错.
代码:
forwarders {
61.153.177.196;
原来是127.0.0.1的,我改成了本地电信DNS <====不知道对否 ?
listen-on { 192.168.1.237; };
原来是127.0.0.1的,我改成了本机内网IP <======不知道对否 ?
代码:
/etc/namedb/master/localhost.rev
$TTL 3600
@ IN SOA ns.wzyako.net. root.ns.wzyako.net. (
20060429 ; Serial
3600 ; Refresh
900 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS ns.wzyako.net.
1 IN PTR localhost.wzyako.net.
/etc/namedb/master/cnc/wzyako.net
$TTL 3600
@ IN SOA ns.wzyako.net. root.ns.wzyako.net. (
20060429001 ; Serial
3600 ; Refresh
900 ; Retry
68400 ; Expire
15 ) ; Minimum
@ IN NS ns.wzyako.net.
@ IN A 221.12.64.220
www IN A 221.12.64.220
;
;end
/etc/namedb/master/telecom/wzyako.net 跟上面的也是一样,换了IP而已
$ cat cnc.def
zone "wzyako.net" {
type master;
file "master/cnc/wzyako.net";
};
启动named时的信息:
ns# /usr/local/sbin/named -gc /etc/namedb/named.conf &
[2] 2285
ns# 29-Apr-2006 23:09:20.477 starting BIND 9.3.2 -gc /etc/namedb/named.conf
29-Apr-2006 23:09:20.480 loading configuration from '/etc/namedb/named.conf'
29-Apr-2006 23:09:20.482 no IPv6 interfaces found
29-Apr-2006 23:09:20.482 listening on IPv4 interface rl0, 192.168.1.237#53
29-Apr-2006 23:09:20.485 /etc/namedb/named.conf:43: couldn't add command channel 127.0.0.1#953: address in use
29-Apr-2006 23:09:20.485 ignoring config file logging statement due to -g option
29-Apr-2006 23:09:20.487 zone 0.0.127.IN-ADDR.ARPA/IN/view_cnc: loaded serial 20060429
29-Apr-2006 23:09:20.487 dns_rdata_fromtext: master/cnc/wzyako.net:10: near '20060429001': out of range
29-Apr-2006 23:09:20.487 zone wzyako.net/IN/view_cnc: loading master file master/cnc/wzyako.net: out of range
29-Apr-2006 23:09:20.488 zone 0.0.127.IN-ADDR.ARPA/IN/view_any: loaded serial 20060429
29-Apr-2006 23:09:20.488 dns_rdata_fromtext: master/telecom/wzyako.net:10: near '20060429001': out of range
29-Apr-2006 23:09:20.488 zone wzyako.net/IN/view_any: loading master file master/telecom/wzyako.net: out of range
29-Apr-2006 23:09:20.489 running
麻烦各位朋友帮帮忙看哪里出错,以及如何解决.拜谢!
[ 本帖最后由 yewei1012 于 2006-4-29 23:40 编辑 ] |
|