Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Wednesday, 13 February 2013

How to configure the DNS in Unix and Linux servers?



How to configure the DNS in Unix and Linux servers?


A) Steps:

First Create the file called /etc/resolv.conf - which includes the primary and secondary DNS server IP address for UNIX system, its your own DNS server.

# touch /etc/resolv.conf
# vi /etc/resolv.conf (Add the following lines to it)
domain test-lob.com  
nameserver ipaddress
nameserver ipaddress
Where, nameserver IP: It is IP of first DNS server and secondary DNS server of test-lob.com.


Search test-lob.com: Default domain name to search.

For example, if you type command nslookup www, it will search it as www.test-lob.com

For AIX Enable the name resolving using DNS as follows:
Edit the file /etc/netsvc.conf so that the “host =” will be pointing to local and dns as in the following
hosts=local,bind

For Solaris and Linux, Enable the name resolving using DNS as follows:
Edit the file /etc/nsswitch.conf so that the “host:” will be pointing to local and dns as in the following
hosts: files dns

B). VALIDATION REQUIREMENTS
Check with nslookup it should be able to resolve the host to IP and IP to host as in the following example
# nslookup
Default Server: change.test-lob.com
Address: 10.14.15.16
> lotus

Server: change.test-lob.com
Address: 10.14.15.16

Name: lotus.test-lob.com
Address: 10.120.12.6

Resolve from IP to host:
nslookup 10.120.12.6

Server: change.test-lob.com
Address: 10.14.15.16


Name: lotus.test-lob.com
Address: 10.120.12.6


C). ROLL BACK
AIX:
Remove the entries you have added in the /etc/netsvc.conf , so that the server will point to local host configuration file ( /etc/hosts ) only.

LINUX & SOLARIS:
Remove the entries you have added in the /etc/nsswitch.conf so that the server will point to local host configuration file ( /etc/hosts ) only.


No comments:

Post a Comment