- 论坛徽章:
- 0
|
各位高手,我希望建立一个智能dns服务器,当请求的源地址是10.0.0.167时将域名www.testsina.com解析为网通cnc的ip:202.108.33.73,当请求的源地址是其它时解析为电信ct的ip:218.30.108.185,现在遇到启动时报错的问题,具体配置文件内容如下:
bsdstudy# /usr/local/named/sbin/named -g -u bind -c /usr/local/named/etc/named.conf &
[1] 629
bsdstudy# 12-Apr-2010 10:24:16.357 starting BIND 9.6.2 -g -u bind -c /usr/local/named/etc/named.conf
12-Apr-2010 10:24:16.360 built with '--prefix=/usr/local/named' '--enable-threads' '--enable-largefile' '--enable-ipv6' '--with-openssl'
12-Apr-2010 10:24:16.360 found 1 CPU, using 1 worker thread
12-Apr-2010 10:24:16.385 using up to 4096 sockets
12-Apr-2010 10:24:16.415 loading configuration from '/usr/local/named/etc/named.conf'
12-Apr-2010 10:24:16.420 max open files (357 is smaller than max sockets (4096)
12-Apr-2010 10:24:16.424 using default UDP/IPv4 port range: [49152, 65535]
12-Apr-2010 10:24:16.426 using default UDP/IPv6 port range: [49152, 65535]
12-Apr-2010 10:24:16.433 listening on IPv4 interface lnc0, 10.0.0.55#53
12-Apr-2010 10:24:16.451 listening on IPv4 interface lo0, 127.0.0.1#53
12-Apr-2010 10:24:16.548 automatic empty zone: view view_cnc: 0.IN-ADDR.ARPA
12-Apr-2010 10:24:16.549 automatic empty zone: view view_cnc: 127.IN-ADDR.ARPA
12-Apr-2010 10:24:16.550 automatic empty zone: view view_cnc: 254.169.IN-ADDR.ARPA
12-Apr-2010 10:24:16.550 automatic empty zone: view view_cnc: 2.0.192.IN-ADDR.ARPA
12-Apr-2010 10:24:16.550 automatic empty zone: view view_cnc: 255.255.255.255.IN-ADDR.ARPA
12-Apr-2010 10:24:16.550 automatic empty zone: view view_cnc: 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.0.IP6.ARPA
12-Apr-2010 10:24:16.550 automatic empty zone: view view_cnc: 1.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
12-Apr-2010 10:24:16.550 automatic empty zone: view view_cnc: D.F.IP6.ARPA
12-Apr-2010 10:24:16.550 automatic empty zone: view view_cnc: 8.E.F.IP6.ARPA
12-Apr-2010 10:24:16.551 automatic empty zone: view view_cnc: 9.E.F.IP6.ARPA
12-Apr-2010 10:24:16.551 automatic empty zone: view view_cnc: A.E.F.IP6.ARPA
12-Apr-2010 10:24:16.551 automatic empty zone: view view_cnc: B.E.F.IP6.ARPA
12-Apr-2010 10:24:16.603 automatic empty zone: view view_ct: 0.IN-ADDR.ARPA
12-Apr-2010 10:24:16.604 automatic empty zone: view view_ct: 127.IN-ADDR.ARPA
12-Apr-2010 10:24:16.604 automatic empty zone: view view_ct: 254.169.IN-ADDR.ARPA
12-Apr-2010 10:24:16.606 automatic empty zone: view view_ct: 2.0.192.IN-ADDR.ARPA
12-Apr-2010 10:24:16.607 automatic empty zone: view view_ct: 255.255.255.255.IN-ADDR.ARPA
12-Apr-2010 10:24:16.608 automatic empty zone: view view_ct: 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.0.IP6.ARPA
12-Apr-2010 10:24:16.610 automatic empty zone: view view_ct: 1.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
12-Apr-2010 10:24:16.612 automatic empty zone: view view_ct: D.F.IP6.ARPA
12-Apr-2010 10:24:16.613 automatic empty zone: view view_ct: 8.E.F.IP6.ARPA
12-Apr-2010 10:24:16.614 automatic empty zone: view view_ct: 9.E.F.IP6.ARPA
12-Apr-2010 10:24:16.615 automatic empty zone: view view_ct: A.E.F.IP6.ARPA
12-Apr-2010 10:24:16.617 automatic empty zone: view view_ct: B.E.F.IP6.ARPA
12-Apr-2010 10:24:16.669 command channel listening on 127.0.0.1#953
12-Apr-2010 10:24:16.671 ignoring config file logging statement due to -g option
12-Apr-2010 10:24:16.679 dns_master_load: named.127.0.0:1: unknown $ directive '$'
12-Apr-2010 10:24:16.681 zone 0.0.127.IN-ADDR.ARPA/IN/view_cnc: loading from master file named.127.0.0 failed: syntax error
12-Apr-2010 10:24:16.682 zone 0.0.127.IN-ADDR.ARPA/IN/view_cnc: not loaded due to errors.
12-Apr-2010 10:24:16.695 dns_rdata_fromtext: testsina.db.cnc:7: near eol: unexpected end of input
12-Apr-2010 10:24:16.696 zone testsina.com/IN/view_cnc: loading from master file testsina.db.cnc failed: unexpected end of input
12-Apr-2010 10:24:16.697 zone testsina.com/IN/view_cnc: not loaded due to errors.
12-Apr-2010 10:24:16.702 zone localhost/IN/view_cnc: loaded serial 42
12-Apr-2010 10:24:16.707 dns_master_load: named.127.0.0:1: unknown $ directive '$'
12-Apr-2010 10:24:16.709 zone 0.0.127.IN-ADDR.ARPA/IN/view_ct: loading from master file named.127.0.0 failed: syntax error
12-Apr-2010 10:24:16.711 zone 0.0.127.IN-ADDR.ARPA/IN/view_ct: not loaded due to errors.
12-Apr-2010 10:24:16.724 dns_rdata_fromtext: testsina.db.ct:7: near eol: unexpected end of input
12-Apr-2010 10:24:16.724 zone testsina.com/IN/view_ct: loading from master file testsina.db.ct failed: unexpected end of input
12-Apr-2010 10:24:16.726 zone testsina.com/IN/view_ct: not loaded due to errors.
12-Apr-2010 10:24:16.732 zone localhost/IN/view_ct: loaded serial 42
12-Apr-2010 10:24:16.740 running
bsdstudy# more named.conf
key "rndc-key" {
algorithm hmac-md5;
secret "ISXjGelm+UYxtBHDuMV5XA==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
acl"my-lan"{
127.0.0/8;10.0.0.0/24;
};
options{
directory "/usr/local/named/etc";
pid-file "/usr/local/named/var/run/named/named.pid";
version "No Status";
allow-recursion {"my-lan";};
};
acl "CNC"{
10.0.0.167;
};
view "view_cnc"{
match-clients{CNC;};
zone "testsina.com" in{
type master;
file "testsina.db.cnc";
};
zone "." in{
type hint;
file "named.root";
};
zone "localhost" in{
type master;
file "localhost.zone";
};
zone "0.0.127.IN-ADDR.ARPA" in{
type master;
file "named.127.0.0";
};
};
view "view_ct"{
match-clients{any;};
zone "testsina.com" in{
type master;
file "testsina.db.ct";
};
zone "." in{
type hint;
file "named.root";
};
zone "localhost" in{
type master;
file "localhost.zone";
};
zone "0.0.127.IN-ADDR.ARPA" in{
type master;
file "named.127.0.0";
};
};
logging{
channel warning{
file "/var/log/named/dns_warnings" ;
severity warning;
};
channel general_dns{
file "/var/log/named/dns_logs" ;
severity info;
};
};
bsdstudy# more testsina.db.cnc
$TTL 3600
@ IN SOA testsina.com.(
2010040801 ;Serial
3600 ;Refresh
300 ;Retry
3600000 ;Expire
3600 ) ;Minimum
IN NS localhost.
www IN A 202.108.33.73
bsdstudy# more testsina.db.ct
$TTL 3600
@ IN SOA testsina.com.(
2010040801 ; Serial
3600 ; Refresh
300 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS localhost.
www IN A 218.30.108.185
bsdstudy# more localhost.zone
$TTL 86400
$ORIGIN localhost.
@ 1D IN SOA @ root(
42 ;serial(d.adams)
3H ;refresh
15M ;retry
1W ;expiry
1D) ;minimum
1D IN NS @
1D IN A 127.0.0.1
bsdstudy# more named.127.0.0
$ TTL 86400
@ IN SOA localhost. root.localhost.(
1997022700 ;Serial
28800 ;Refresh
14400 ;Retry
3600000 ;Expire
86400) ;Minimum
IN NS localhost.
1 IN PTR localhost. |
|