Resolve and Caching with Bind9 Nameserver


Needs:
We are required to resolve our internal domains on a local nameserver and external (Internet) domains from ISP’s nameserver. There are different solutions to this problem, but in this howto, we are going to solve it through configuring a combination of caching-nameserver and BIND 9.

Installation:
$yum install caching-nameserver bind*

Configuration:
Step1. check /etc/named.caching-nameserver.conf , if exist, plz go on
include "/etc/named.rfc1912.zones";

Step2. add our zones (bold lines) to /etc/named.rfc1912.zones, it should like:

......
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
zone "linuxdict.com" IN {
type master;
file "linuxdict.com.zone";
allow-update { none; };
};

Step3. create our zone file in /var/named/chroot/var/named/ (if doesn’t exist, creat in /var/named)
/var/named/chroot/var/named/linuxdict.com.zone, content of our zone file
$TTL 86400
@ IN SOA @ xfsuper.gmail.com. (
2010031803 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS ns.linuxdict.com.
winxp IN A 192.168.1.107
ns IN A 192.168.1.201
dev IN CNAME ns
monitor IN A 192.168.1.202
repo IN A 192.168.1.203

Step4. service named start

Step5. change client DNS :)

PS: don’t forget to change the options:
listen-on port 53 { 127.0.0.1;your_dns_server_ip; };
allow-query { 192.168.1.0/24; };
allow-query-cache { localhost; 192.168.1.0/24;};

  1. No comments yet.
(will not be published)