So how do you set DNS namserver under Sun Solaris UNIX system? The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed to be human readable and contains a list of keywords with values that provide various types of resolver information.
Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS (currently 3, see
DNS Client Setup
First Create the file called /etc/resolv.conf - which includes the primary and secondary DNS server IP address for Solaris system, it can be your own DNS server or your ISPs DNS server:
# touch /etc/resolv.conf
Open /etc/resolv.conf using vi text editor:
# vi /etc/resolv.conf
Add the following lines to it:
search nixcraft.in nameserver 202.54.1.30 nameserver 202.54.1.18
Where,
- nameserver IP : It is IP of first DNS server
- search nixcraft.in : Default domain name to search. For example, if you type command nslookup www, it will search it as www.nixcraft.in
2) Enable the name resolving using DNS as follows:
# cp /etc/nsswitch.dns /etc/nsswitch.conf
3) Test new name server by running the nslookup command as follows:
# nslookup nixcraft.in
OR
# /usr/sfw/sbin/nslookup nixcraft.in
Output:
Server: gwbsd2vsnl.nixcraft.in Address: 192.168.1.202 Non-authoritative answer: Name: nixcraft.in Address: 202.71.128.225
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop











{ 12 comments… read them below or add one }
This works! GREAT! THANKS!
It really works. Never did a Solaris configuration yet, well ’till now.
Might be because of
1) Your solaris system is using DHCP to get all info such as IP, Router, DNS server etc
2) You configured DNS while installing Solaris itself
3) OR may be you have configured NIS+ Client to Use DNS
Thanks my solaries server is able to connect with my linux dns server!!! Thanks once again.
How do you prevent the resolver from appending your domain name to the end of a query?
For example, if my domain name is mydomain.ARPA and I do a lookup for foo.com, how do I prevent my resolver from first trying to resolve foo.com.mydomain.ARPA?
Still having problems with SRV DNS queries.
This works !!! excellent
yeah!!!it working for sun solaris…thank you…
its done. thanks for sharing.
#cp /etc/nsswitch.dns /etc/nsswitch.conf and than #init 6
It works … thanks …
Awesome. Fixed my Settings.
Thanks a lot!
Work fine.
Thanks a loot.