You may use the following method to configure the Domain Name System (DNS) servers that Linux CentOS (http://www.centos.org/) will use. In this particular example the server will be configured to use the well known Google public DNS servers that utilize the following Internet Protocol (IP) addresses: 8.8.8. & 188.8.131.52.
Begin by logging into the server and elevating to the root user. You may verify the current user by issuing the whoami command.
# whoami root
Next, navigate to the /etc directory.
# cd /etc
# pwd /etc
Now, you may use the editor of your choice to edit the resolv.conf file. In this example I will be using the nano text editor.
# nano -w resolv.conf
Once the file opens use the following syntax to specify the name servers: nameserver IP Address (see the edited file below).
Close the editor by using ctrl+x and saving the file.
The file step is to test the configuration. This can be done by using the nslookup command to resolve a fully qualified domain name to an IP address.
# nslookup cnn.com Server: 184.108.40.206
The fact that cnn.com is resolving to multiple IP addresses is most likely due to the fact that they are utilizing load balancing. Additionally, this completes the configuration.