LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Help me configure BIND on LAN and WAN ? (https://www.linuxquestions.org/questions/linux-server-73/help-me-configure-bind-on-lan-and-wan-745279/)

thamkhaohochoi 08-05-2009 08:29 AM

Help me configure BIND on LAN and WAN ?
 
People take some time to guide them how to configure BIND in LAN and WAN. Requirements of children: IP 113.134.x.100 province, domain names they bought at pavietnam. My distro is Centos 5.3

Domain thunghiem.com can run both in LAN and WAN network

/var/named/chroot/etc/named.conf
Quote:


//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
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";

// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;

allow-query { localhost; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

view "internal" {
match-clients { localnets; };
match-destinations { localnets; };
recursion yes;
include "/etc/named.rfc1912.zones";
include "/var/named/chroot/var/named/named.thunghiem.com.zone";
};

view "external" {
match-clients { any; };
match-destinations { any; };
recursion no;
include "/var/named/chroot/var/named/named.thunghiem.com.zone.wan;"
/var/named/chroot/etc/named.thunghiem.com.zone
Quote:

zone "phimtambay.com" {
type master;
file "thunghiem.com.db";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "1.168.192.in-addr.arpa.db";
};
/var/named/chroot/etc/named.thunghiem.com.zone.wan
zone "thunghiem.com" {
type master;
file "thunghiem.com.db.wan";
allow-query { any; };
};

/var/named/chroot/var/named/thunghiem.com.db
Quote:

$TTL 86400
@ IN SOA thunghiem.com. root.thunghiem.com.(
2009080590 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS thunghiemy.com.
IN MX 10 thunghiem.com.
@ IN A 192.168.1.20
* IN A 192.168.1.20
/var/named/chroot/var/named/1.168.192.in-addr.arpa.db
Quote:

$TTL 86400
@ IN SOA thunghiem.com. root. thunghiem.com.(
20090805901 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS thunghiem.com.
20 IN PTR thunghiem.com.
vi /var/named/chroot/var/named/thunghiem.com.db.wan
Quote:

$TTL 86400
@ IN SOA mail.thunghiem.com. root.thunghiem.com(
2006041401 ; Serial
7200 ; Refresh
7200 ; Retry
2419200 ; Expire
86400 ) ; Minimum
IN NS mail.thunghiem.com. 
IN MX 10 thunghiem.com.
mail IN A X.X.X.X 
@ IN A X.X.X.X 
www IN A X.X.X.X 
ftp IN A X.X.X.X
mail IN A X.X.X.X 
thunghiem.com IN TXT "v=spf1 a mx ~all"
X.X.X : IP Public

/etc/init.d/named start
Quote:

Starting named:
Error in named configuration:
/etc/named.conf:41: open: /var/named/chroot/var/named/named.thunghiem.com.zone: file not found
[FAILED]
When I start named error file not found, although this file has links /var/named/chroot/var/named . I based this document to configure the [url] hxxp://centossrv.com/bind-centos5.shtml [/ url]

Sorry my english

bathory 08-05-2009 11:06 AM

You're running named chrooted to /var/named/chroot directory, so according to your named.conf the absolute path for the zone file is:
/var/named/chroot/var/named/chroot/var/named/named.thunghiem.com.zone
I guess this is not what you want and that's why named complains that it cannot find it. The correct argument to the include statement should be:
Quote:

include "/var/named/named.thunghiem.com.zone";


All times are GMT -5. The time now is 02:24 PM.