*******************************
OS: Linux CentOS-59
Bind version: BIND 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.5
(Bind imbedded within CentOS-59)
CONDITION:
**************
1- Two different Domain
clear.net.nz
example.com
2- Two different FQDN mapping IP 10.11.0.1 & 10.11.0.2
digihost.clear.net.nz --> 10.11.0.1
digihost.usr.clear.net.nz --> 10.11.0.2
digihost.example.com --> 10.11.0.1
dhweb.example.com --> 10.11.0.2
PROCEDURE:
***************
Establish following 4 files on each path as below right side.
named.conf (744) --> path: /var/named/chroot/etc/
named.10.11.0 --> path: /var/named/chroot/var/named/
named.example.com --> path: /var/named/chroot/var/named/
named.clear.net.nz ---> path: /var/named/chroot/var/named/
# vi named.conf
# vim named.10.11.0
~~~~ CONTENT START ~~~~
$TTL 86400
@ IN SOA digihost.example.com. dhweb.example.com. (
2013080800 ; serial (d. adams)
28800 ; refresh
14400 ; retry
691200 ; expiry
86400 ) ; minimum
@ IN NS digihost.example.com.
;
$ORIGIN 0.11.10.in-addr.arpa.
;
1 IN PTR digihost.example.com.
2 IN PTR dhweb.example.com.
~~~~ CONTENT END ~~~~
# vim named.clear.net.nz
~~~~ CONTENT START ~~~~
$TTL 86400
@ IN SOA digihost.clear.net.nz. digihost.usr.clear.net.nz. (
2013080800 ; serial (d. adams)
28800 ; refresh
14400 ; retry
691200 ; expiry
86400 ) ; minimum
;
IN TXT "A test domain, clear.net.nz., created by MTT."
IN NS digihost
IN A 10.11.0.1
;
$ORIGIN clear.net.nz.
;
localhost IN A 127.0.0.1
;
digihost IN A 10.11.0.1
digihost.usr IN A 10.11.0.2
~~~~ CONTENT END ~~~~
# vim named.example.com
~~~~ CONTENT START ~~~~
$TTL 86400
@ IN SOA digihost.example.com. dhweb.example.com. (
2013080800 ; serial (d. adams)
28800 ; refresh
14400 ; retry
691200 ; expiry
86400 ) ; minimum
;
IN TXT "A test domain, example.com., created by Lu."
IN NS digihost
IN A 10.11.0.1
;
$ORIGIN example.com.
;
localhost IN A 127.0.0.1
;
digihost IN A 10.11.0.1
dhweb IN A 10.11.0.2
~~~~ CONTENT END ~~~~
Have soft-link for 3 files of named.10.11.0, named.clear.net.nz & named.example.com on path: /var/named
# ln -s /var/named/chroot/var/named/named.10.11.0
# ln -s /var/named/chroot/var/named/named.clear.net.nz
# ln -s /var/named/chroot/var/named/named/example.com
Reload DNS
# service named restart
TROUBLESHOOTING
***********************
1- If got a error event after restart the DNS
--> Locating /var/named/chroot//etc/named.conf failed:
--> [FAILED]
means there is something wrong with named.conf.
check the path where located named.conf.
previous Bind version is /etc/named.conf, and current correct one is /var/named/chroot/etc/named.conf.
EXTRA CONFIGURATION for reference
***********************************************************************
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
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" {
type master;
file "named.local";
allow-update { none; };
};
zone "0.11.10.in-addr.arpa" {
type master;
file "named.10.11.0";
allow-update { none; };
};
zone "example.com" {
type master;
file "named.example.com";
};
zone "clear.net.nz" {
type master;
file "named.clear.net.nz";
};
include "/etc/rndc.key";
===========================================
沒有留言:
張貼留言