DNS HOW TO Notes:
- this short tutorial will help you to have a start point, a system setup correct and open to any dvelopment
- it is not relevant how you did install
bind (just use the
rpm command or using any tool which will setup it with default configuration in
jail). It means the folders structure under /var/named/chroot exists.
- you will undestand basic configuration (no security issue is touched) using no graphics interface, just you and your black screen.
- your system should have just the gateway and static IP, nothing in /etc/resolv.conf
- will be setup the domain: test.local and the machine's IP is 192.168.10.10
1)
create named.conf #vi /var/named/chroot/etc/named.conf
its content will be:
zone "0.0.127.in-addr.arpa" (
type master;
file "/var/named/127.0.0.rev";
);
zone "test.local" (
type master;
file "/var/named/test.local";
);
zone "0.0.127.in-addr.arpa" (
type master;
file "/var/named/192.68.10.rev";
);
* replace ( with 2)
create 127.0.0.rev #vi /var/named/chroot/var/named/127.0.0.rev its content will be:
$TTL 3D
@ IN SOA ns.test.local. hostmaster.test.local. (
1;
8H;
2H;
4W;
1D);
NS ns.test.local.
1 PTR localhost.3)
create test.local #vi /var/named/chroot/var/named/test.local (we suppose this is mail server as well)
its content will be:
@ IN SOA ns.test.local. hostmaster.test.local. (
1;
8H;
2H;
4W;
1D);
NS ns
MX 10 mail.test.local.
localhost A 127.0.0.1
ns A 192.168.10.10
mail A 192.168.10.10 4)
create 192.168.10.rev #vi /var/named/chroot/var/named/192.168.10.rev
its content will be:
$TTL 3D
@ IN SOA ns.test.local. hostmaster.test.local. (
1;
8H;
2H;
4W;
1D);
NS ns.test.local.
10 PTR ns.test.local.
10 PTR mail.test.local.
5)
restart bind #/etc.init.d/named restart
6)
check your work - PTR records with:
# dig -x 127.0.0.1
# dig -x 192.168.10.10you should get all sections: Questions, Answer, Authoritive and Additional
- main zone
# dig any test.local you should get all sections: Questions, Answer, Authoritive and Additional
- zone transfer
# dig 0.0.127.in-addr.arpa asfr
# dig 10.168.192.in-addr.arpa asfr
# dig test.local asfr you sholud not recived "zone transfer faild.
7) add as many zone and entry as you need, create view.. now its time for strings and strace. DNS has huge resources on the net.
DNS PROLEMS1)
What you have to do if your DNS seems do not work properly -
- be shure that it is is running
# /etc/init.d/named restart
Oance it is completed, you should not see "faild"
- pick up one domein name you have setup in your dns. Let's suppose it is mydomain.ext
#grep mydomain.ext $OGFILE ($LOGFILE may be /var/log/message)
you sould get: zone mydomain.ext/IN: loaded serial NNNNNN
if you cannot get it it means your zone is not loaded and you must:
check named.conf
(a common error based on this is " ... no-authoritive answer")
SMALL BUSINESS SERVER 2003 (SBS 2003)