Site icon UnixArena

How to Configure DNS Server and Client on Solaris 11 ?

Domain Name System is responsible for assigning domain names and mapping those names to IP address. In other words, it resolves the IP address to hostname and hostname to IP address. I am sure that customers won’t be ready to run Solaris 11 box as DNS server but still i just would like to share the method of configuring DNS server on Solaris 11. In most of the organization,  the DNS server will be running on windows servers or Linux servers because of cost effective. But still few customers would like to use Unix operating systems for DNS too. Hope this post will be helpful for those people. 


Configuring DNS service on Solaris11:
First you need to install the necessary DNS packages to configure DNS server. The default installation won’t install those packages. 

1. Install the DNS packages.
root@UAAIS:~# pkg install service/network/dns/bind
Creating Plan (Solver setup): |
Creating Plan (Evaluating mediators): \
2.Verify the installed packages.
root@UAAIS:~# pkg list |grep -i bind
network/dns/bind 9.6.3.7.2-0.175.1.0.0.24.0 i--
service/network/dns/bind 9.6.3.7.2-0.175.1.0.0.24.0 i--
root@UAAIS:~#


3.Create a new named.conf file under /etc directory .
root@UAAIS:~# cat /etc/named.conf
options {
directory "/etc/namedb/working";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
};

zone "arenadc" {
type master;
file "/etc/namedb/master/arenadc.db";
};

zone "2.168.192.in-addr.arpa" {
type master;
file "/etc/namedb/master/2.168.192.db";
};
root@UAAIS:~#

As per the above configuration file, arenadc is domain name and this domain uses the network  192.168.2.0 .

4.Create a necessary directories for DNS.

root@UAAIS:~# mkdir /var/dump
root@UAAIS:~# mkdir /var/stats
root@UAAIS:~# mkdir -p /var/run/namedb
root@UAAIS:~# mkdir -p /etc/namedb/master
root@UAAIS:~# mkdir -p /etc/namedb/working


5.Create a forward lookup file for DNS server as like below.

root@UAAIS:~# cat /etc/namedb/master/arenadc.db
$TTL 3h
@ IN SOA UAAIS.arenadc. root.UAAIS.arenadc. (
2013022744
28800
3600
604800
38400
)

arenadc. IN NS UAAIS.arenadc.
SOL11C1 IN A 192.168.2.41 ; Sol11 DNS client

root@UAAIS:~#

Note: arenadc is domain name and UAAIS is our DNS server name.

6.Create a reverse lookup file for DNS server as like below.

root@UAAIS:~# cat /etc/namedb/master/2.168.192.db
$TTL 3h
@ IN SOA UAAIS.arenadc. root.UAAIS.arenadc. (
2013022744
28800
3600
604800
38400
)

IN NS UAAIS.arenadc.
41 IN PTR SOL11C1.arenadc; Sol11 DNS client
root@UAAIS:~#


You need to add the host and IP information on these files to reflect in DNS.
Ex: Here i have one DNS client SOLC11C1(192.168.2.41)

7.Time to enable the DNS server service.

root@UAAIS:~# svcadm enable dns/server
root@UAAIS:~# svcs dns/server
STATE STIME FMRI
online 1:09:58 svc:/network/dns/server:default
root@UAAIS:~#


Configuring the DNS client:
1. Login to DNS client machine and perform the below steps.Let me login to SOL11C1 host.

root@SOL11C1:~# svccfg -s network/dns/client setprop config/nameserver = net_address: 192.168.2.31
root@SOL11C1:~# svccfg -s network/dns/client setprop config/domain = astring: arenadc
root@SOL11C1:~# svccfg -s network/dns/client setprop config/search = astring: arenadc
root@SOL11C1:~# svccfg -s name-service/switch setprop config/ipnodes = astring: '"files dns"'
root@SOL11C1:~# svccfg -s name-service/switch setprop config/host = astring: '"files dns"'
root@SOL11C1:~# svccfg -s network/dns/client listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 192.168.2.31
config/domain astring arenadc
config/search astring arenadc
root@SOL11C1:~#

DNS server IP:192.168.2.31
Domain Name:arenadc

2.Enable  the DNS client service.

root@SOL11C1:~# svcadm enable dns/client
root@SOL11C1:~# svcs dns/client
STATE STIME FMRI
online 1:13:15 svc:/network/dns/client:default
root@SOL11C1:~#


The above commands just updates the /etc/resolv.conf file like below.

root@SOL11C1:~# cat /etc/resolv.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
# DO NOT EDIT THIS FILE. EDITS WILL BE LOST.
# See resolv.conf(4) for details.

domain arenadc
search arenadc
nameserver 192.168.2.31
root@SOL11C1:~#



Its time to test our work,

root@SOL11C1:~# nslookup SOL11C1
Server: 192.168.2.31
Address: 192.168.2.31#53

Name: SOL11C1.arenadc
Address: 192.168.2.41

root@SOL11C1:~#

root@SOL11C1:~# nslookup 192.168.2.41
Server: 192.168.2.31
Address: 192.168.2.31#53

41.2.168.192.in-addr.arpa name = SOL11C1.arenadc.2.168.192.in-addr.arpa.

root@SOL11C1:~#

Awesome…You have successfully configured the DNS server and DNS client.

DNS uses port 53.So please make sure the port is open between DNS server and client from network firewall level.

Thank you for visiting UnixArena. Please leave a comment if you have any doubt.

Exit mobile version