How To Check Your Primary and Secondary DNS Servers in Linux Shell

this blog post shows you how to check for your primary and secondary DNS name servers

Courtesy: Webune.com

I will be using Red Hat for this demonstration that will help you find out what is your primary and your secondary DNS servers are setup in your linux computer or server. for example, i have a server with CentOS.

at the terminal shell type:

cat /etc/resolv.conf

This command will display your Primary and Secondary Server Ip Address. It will look like this:

 


; generated by /sbin/dhclient-script
search wallpaperama.com
nameserver 210.92.171.7
nameserver 210.92.179.16


If you want to change it, you can do the following command to edit the file (or you can use vi or other favorite editor. if you are a beginner like me, i would start with nano)

 

 

nano /etc/resolve.conf

*disclaimer: I take no responsability for any loss or damages to your server/data. Always make backups before you start doing something like this, no matter is you are and expert or a beginner.
8787 - Sat Feb 02, 2013 22:11:24