CONFIGURING BIND DNS SERVER:
==============================
pkginfo -x |grep -i bind
SUNWbind - main Bind package
SUNWbindr - Service management
pkgchk -l SUNWbindr
pkgchk -l SUNWbind
dig mail.yahoo.com
dig mail.yahoo.com ns
dig mail.yahoo.com mx
By default /var/named and /etc/named.conf does not exist
create /etc/named.conf
options {
directory "/var/named";
};
###Special zone of root of DNS###
zone "." {
type hint;
file "db.cache";
};
###Reverse zone###
zone "0.0.127.in-addr.arpa" {
type master;
file "db.127.0.0";
};
zone "0.16.172.in-addr.arpa" {
type master;
file "db.172.16.0";
};
###Forward Zone###
zone "unix.com" {
type master;
file "db.unix.com";
};
Save and exit
Download hint file,
mkdir /var/named
cd /var/named/
wget ftp://ftp.rs.internic.net/domain/named.root
ls -l
mv named.root db.cache
Creating Zone Files:
>> reverse lookup zone
gedit /var/named/db.127.0.0
@ IN SOA pc1.unix.com. root.unix.com. (
2011062001 ; Serial number
7200 ; Refresh Interval
3600 ; Retry Interval
86400 ; Expiry
600 ); Minimum TTL
NS pc1.
1 IN PTR localhost.
save & exit
gedit /var/named/db.172.16.0
@ IN SOA pc1.unix.com. root.unix.com. (
2011062001 ; Serial number
7200 ; Refresh Interval
3600 ; Retry Interval
86400 ; Expiry
600 ); Minimum TTL
NS pc1.
1 IN PTR pc1.
##1 is for 172.16.0.1##
save & exit
gedit /var/named/db.172.16.0
@ IN SOA pc1.unix.com. root.unix.com. (
2011062001 ; Serial number
7200 ; Refresh Interval
3600 ; Retry Interval
86400 ; Expiry
600 ); Minimum TTL
NS pc1.
1 IN PTR pc1.
##1 is for 172.16.0.1##
save & exit
gedit /var/named/db.unix.com
@ IN SOA pc1.unix.com. root.unix.com. (
2011062001 ; Serial number
7200 ; Refresh Interval
3600 ; Retry Interval
86400 ; Expiry
600 ); Minimum TTL
NS pc1.
pc1 IN A 172.16.0.1
pc2 IN A 172.16.0.2
save & exit
svcadm enable dns/server
svcs -l dns/server
dig @localhost pc1.unix.com
vi /etc/resolv.conf
domain unix.com
search unix.com
nameserver 172.16.0.1
nameserver 8.8.8.8
dig @localhost www.google.com
1655ms
dig @localhost www.google.com
1ms
NOTE: Always works as caching-only NS
gedit /var/named/db.unix.com
@ IN SOA pc1.unix.com. root.unix.com. (
2011062002 ; Serial number
7200 ; Refresh Interval
3600 ; Retry Interval
86400 ; Expiry
600 ); Minimum TTL
NS pc1.unix.com.
IN MX 10 pc1.unix.com.
pc1 IN A 172.16.0.1
pc2 IN A 172.16.0.2
save & exit
svcadm restart dns/server
dig @localhost pc1.unix.com mx
gedit /var/named/db.unix.com
@ IN SOA pc1.unix.com. root.unix.com. (
2011062003 ; Serial number
7200 ; Refresh Interval
3600 ; Retry Interval
86400 ; Expiry
600 ); Minimum TTL
NS pc1.unix.com.
IN MX 10 pc1.unix.com.
pc1 IN A 172.16.0.1
pc2 IN A 172.16.0.2
www CNAME ns1.unix.com.
save & exit
svcadm restart dns/server
dig @localhost www.unix.com cname
No comments:
Post a Comment