Q. How do I setup DNS Lookup under any Linux distribution ?
A. When an application (such as mail client or browser) makes a request which requires a DNS lookup, such programs send a resolution request to the local DNS resolver in the local operating system, which in turn handles the communications required. Under Linux resolver is configured via /etc/resolv.conf file. Open this file as a root user, enter:
# vi /etc/resolv.conf
Append or modify as follows into the file:
search nixcraft.com
nameserver 4.2.1.1
nameserver 4.2.1.2
nameserver 4.2.1.3
Save and close the file. Replace nixcraft.com with your actual domain name. 4.2.1.1 is first name server address. Save and close the file. Test setup, enter:
$ host cyberciti.com
$ host -t ns cyberciti.com
Sample output:
cyberciti.com name server ns2.nixcraft.net. cyberciti.com name server ns1.nixcraft.net. cyberciti.com name server ns3.nixcraft.net.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 1 comment… read it below or add one }
A better setup is
nameserver 4.2.1.1
nameserver 4.2.1.2
nameserver 4.2.1.3
option rotate
option timeout:1
‘rotate’ sets RES_ROTATE in _res.options, which causes round robin selection of nameservers from among those listed.
‘timeout’ sets the amount of time the resolver will wait for a response from a remote name server before retrying the query via a different name server.