Setting up the Primary DNS Server
Create the /etc/named.conf file
options
{
directory “/var/named”;
};
zone “.”
{
type hint;
file “db.root”;
};
zone “bitmind.info”
{
type master;
file “db.bitmind.info”;
};
zone “10.168.192.in-addr.arpa”
{
type master;
file “db.192.168.10″;
};
zone “0.0.127.in-addr.arpa” in
{
type master;
file “db.127.0.0″;
};
Create the /var/named directory
;
; db.root
;
;{name} {ttl} Class NS Nameserver Name
;————————————————————–
. 604800 IN NS bitmind.info.
;
;{name} {ttl} Class A IP Address
;———————————————————
bitmind.info. 604800 IN A 192.168.10.1
#
Next we create the /var/named/db.vinnie.bitmind.info file
; db.bitmind.info
$TTL 86400
;
;{name} {ttl} Class SOA Origin Postmaster
;———————————————————————————-
@ IN SOA vinnie.bitmind.info. root.vinnie.bitmind.info. (
2005010101 ; Serial
3600 ; Refresh (1 Hour)
1800 ; Retry (30 Minutes)
6048000 ; Expire (1 Week)
86400 ) ; Minimum (24 Hours)
;
;{name} {ttl} Class NS Nameserver Name
;——————————————————
IN NS vinnie.bitmind.info.
;
;{name} {ttl} Class A IP Address
;————————————————-
vinnie IN A 192.168.10.5.
paz IN A 192.168.10.6.
localhost IN A 127.0.0.1
;
Next we create the /var/named/db.192.168.10 file
; db.192.168.10
;
$TTL 86400
;
;{name} {ttl} Class SOA Origin Postmaster
;———————————————————————————-
@ IN SOA vinnie.bitmind.info. root.vinnie.bitmind.info. (
2005010101 ; Serial
3600 ; Refresh (1 Hour)
1800 ; Retry (30 Minutes)
6048000 ; Expire (1 Week)
86400 ) ; Minimum (24 Hours)
;{name} {ttl} Class NS Nameserver Name
;——————————————————
IN NS vinnie.bitmind.info.
IN NS paz.bitmind.info.
;
;{name} {ttl} Class PTR Real Name
;————————————————
5 IN PTR vinnie.bitmind.info.
6 IN PTR paz.bitmind.info.
Next we create the /var/named/db.127.0.0 file
; db.127.0.0
;
$TTL 86400
;
;{name} {ttl} Class SOA Origin Postmaster
;———————————————————————————-
@ IN SOA vinnie.bitmind.info. root.vinnie.bitmind.info. (
2005010101 ; Serial
3600 ; Refresh (1 Hour)
1800 ; Retry (30 Minutes)
6048000 ; Expire (1 Week)
86400 ) ; Minimum (24 Hours)
;
;{name} {ttl} Class NS Nameserver Name
;——————————————————
IN NS vinnie.bitmind.info.
;
;{name} {ttl} Class PTR Real Name
;————————————————
1 IN PTR localhost.
On the Primary DNS and all systems we will copy the /etc/nsswitch.dns file to /etc/nsswitch.conf
#cp /etc/nsswitch.dns /etc/nsswitch.conf
Next we will setup the /etc/resolv.conf file on the DNS server and clients
Domain bitmind.info
nameserver 192.168.10.1
search bitmind.info
Enabling DNS on the primary server
svcadm enable svc:/network/dns/server:default
svcadm enable svc:/network/dns/client:default
To check for any errors you can run the tail command on the /var/adm/messages file
tail -4 /var/adm/messages
If the DNS service started without error you will see a message:
Nov 12 13:23:18 seven named[1516]: [ID 873579 daemon.notice] starting BIND 9.2.4
Nov 12 13:23:18 seven named[1516]: [ID 873579 daemon.notice] command channel listening
on ::1#953
Nov 12 13:23:18 seven named[1516]: [ID 873579 daemon.notice] running
Enabling DNS for the Clients
To enable dns on the clients we must start the dns client service
svcadm enable svc:/network/dns/client:default
Test and debug using DIG
dig @192.168.10.5 vinnie.bitmind.info
Setting up the Secondary DNS server
The /var/named directory must be created.
Update the forward and reverse lookup files to add the secondary server.
; db.192.168.10
;
$TTL 86400
;
;{name} {ttl} Class SOA Origin Postmaster
;———————————————————————————-
@ IN SOA vinnie.bitmind.info. root.vinnie.bitmind.info. (
2005010101 ; Serial
3600 ; Refresh (1 Hour)
1800 ; Retry (30 Minutes)
6048000 ; Expire (1 Week)
86400 ) ; Minimum (24 Hours)
;{name} {ttl} Class NS Nameserver Name
;——————————————————
IN NS vinnie.bitmind.info.
IN NS paz.bitmind.info.
;
;{name} {ttl} Class PTR Real Name
;————————————————
5 IN PTR vinnie.bitmind.info.
6 IN PTR paz.bitmind.info.; db.bitmind.info
$TTL 86400
;
;{name} {ttl} Class SOA Origin Postmaster
;———————————————————————————-
@ IN SOA vinnie.bitmind.info. root.vinnie.bitmind.info. (
2005010101 ; Serial
3600 ; Refresh (1 Hour)
1800 ; Retry (30 Minutes)
6048000 ; Expire (1 Week)
86400 ) ; Minimum (24 Hours)
;
;{name} {ttl} Class NS Nameserver Name
;——————————————————
IN NS vinnie.bitmind.info.
IN NS paz.bitmind.info.
;
;{name} {ttl} Class A IP Address
;————————————————-
vinnie IN A 192.168.10.5
paz IN A 192.168.10.6localhost IN A 127.0.0.1
;
Next we must update the clients /etc/resolv.conf files to add the secondary dns for resolution
Domain bitmind.info
nameserver 192.168.10.1
nameserver 192.168.10.2
search bitmind.info
Next we will create the /etc/named.conf file
options
{
directory “/var/named”;
};
zone “.”
{
type hint;
file “db.root”;
};
zone “bitmind.info”
{
type slave;
file “db.bitmind.info.slave”;
masters
{
192.168.10.2;
};
};
zone “10.168.192.in-addr.arpa”
{
type slave;
file “db.192.168.10.slave”;
masters
{
192.168.10.2;
};
};
zone “0.0.127.in-addr.arpa” in
{
type slave;
file “db.127.0.0.slave”;
masters
{
192.168.10.2
};
};
Enable the DNS services on the secondary DNS server.
svcadm enable svc:/network/dns/server:default
svcadm enable svc:/network/dns/client:default
Test and verify forward and reverse lookups
dig @192.168.10.5 vinnie.bitmind.info
ping 192.168.10.5
ping vinnie.bitmind.info
Tags: vtp, study, switch, guides, 802.1q, cisco