PDA

View Full Version : DNS BIND Setup



keatonvictor
9th August 2008, 01:26 PM
Hi Guys

I am playing around with DNS Servers and DNS Zone Transfers. but most of the servers I do are obviously restricted. so I do not have permissions to output DNS information into a txt file.

So I want to setupa DNS server in my local network.

I have a master server which I have http/ssh/ftp etc running on. which I use to connect to the other 4 computers in my house.

Am I right in saying that I can install BIND on this machine which will then assign information such as HINFO, TXT,A information bassed on these local address

192.168.2.1 etc

I want to do this becasue I want to test out zone transfers on a server that is not restricted.

If this is possible, please help me as I do not know how to configure the files.


Thanks everyone

briantan
9th August 2008, 04:08 PM
To setup an internal use domain server:

Say your server is 192.168.2.1 and pcs are .11 thru .14. The following setup a forward and a reverse zone. Change "mydomain" to whatever you fancy. Add other TXT and HINFO as you see fit.


# vi /etc/named.conf
.....
zone "mydomain.com" IN {
type master;
file "zone.mydomain.com";
};

zone "168.192.in-addr.arpa" IN {
type master;
file "named.internal";
};


# vi /var/named/named.internal
$ORIGIN .
$TTL 86400 ; 1 day
168.192.in-addr.arpa IN SOA 168.192.IN-ADDR.ARPA. root.localhost.168.192.IN-ADDR.ARPA. (
2008080801 ; serial
8H ; refresh
2H ; retry
1W ; expire
1D ; minimum
)
NS ns.mydomain.com.
$ORIGIN 2.168.192.in-addr.arpa.
$TTL 1800 ; 30 minutes
1 PTR gw.mydomain.com.
11 PTR pc11.mydomain.com.
12 PTR pc12.mydomain.com.
13 PTR pc13.mydomain.com.
14 PTR pc14.mydomain.com.


# vi /var/named/zone.mydomain.com
$ORIGIN .
$TTL 86400 ; 1 day
mydomain.com IN SOA gw.mydomain.com. postmaster.gw.mydomain.com. (
2008080801 ; serial
8H ; refresh
2H ; retry
1W ; expire
1D ; minimum
)
NS ns.mydomain.com.
A 192.168.2.1
MX 10 po.mydomain.com.
$ORIGIN mydomain.com.
$TTL 1800 ; 30 minutes
gw CNAME @
ns A 192.168.2.1
po A 192.168.2.1
pc1 A 192.168.2.11
pc2 A 192.168.2.12
pc3 A 192.168.2.13
pc4 A 192.168.2.14
Note the "." after FQDN in zone files.

# chown named /var/named/zone.mydomain.com /var/named/named.internal
# service named restart

check /var/log/messages for any syntax error reported.

If you are using bind-chroot, change the path of zone files to /var/named/chroot/var/named/xxxxx accordingly.

oneofmany
9th August 2008, 04:29 PM
great tutorial braintan

keatonvictor
9th August 2008, 06:49 PM
Wow

thanks dude, I will give that a go and get back to you soon.