Category: Domain Name System

Linux CentOS – Configuring DNS Servers

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. & 8.8.4.4.

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).

nameserver 8.8.8.8

nameserver 8.8.4.4

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: 8.8.8.8

Address: 8.8.8.8#53

 

Non-authoritative answer:

Name: cnn.com

Address: 157.166.226.25

Name: cnn.com

Address: 157.166.226.26

Name: cnn.com

Address: 157.166.255.18

Name: cnn.com

Address: 157.166.255.19

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.

Enjoy!


Domain Name System – Propagation

If you ever update Domain Name System (DNS) records on a DNS server you may use the following method to verify that the updated record(s) are propagating to all internet DNS servers. The server in this example is utilizing Linux CentOS-5.5 64bit.

The command you may use is the following “nslookup” and the manual reveals the following information concerning the syntax of this command.

NAME
nslookup – query Internet name servers interactively

SYNOPSIS
nslookup [-option] [name | -] [server]

For instance, if I wanted to verify the A record for the domain google.com on separate DNS servers then I would use the following command.

# nslookup google.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: google.com
Address: 74.125.115.104
Name: google.com
Address: 74.125.115.105
Name: google.com
Address: 74.125.115.147
Name: google.com
Address: 74.125.115.99
Name: google.com
Address: 74.125.115.103
Name: google.com
Address: 74.125.115.106

# nslookup google.com 128.107.241.185
Server: 128.107.241.185
Address: 128.107.241.185#53

Non-authoritative answer:
Name: google.com
Address: 209.85.229.147
Name: google.com
Address: 209.85.229.99
Name: google.com
Address: 209.85.229.104

# nslookup google.com 151.197.0.38
Server: 151.197.0.38
Address: 151.197.0.38#53

Non-authoritative answer:
Name: google.com
Address: 74.125.91.104
Name: google.com
Address: 74.125.91.103
Name: google.com
Address: 74.125.91.106
Name: google.com
Address: 74.125.91.105
Name: google.com
Address: 74.125.91.147
Name: google.com
Address: 74.125.91.99

The examples above query the Google, Cisco and Verizon DNS servers. During a search on the internet, I found the following list of public DNS servers that you may use.

Google
======
8.8.8.8
8.8.4.4

Level 3 Communications (Broomfield, CO, US)
=============================
4.2.2.1
4.2.2.2
4.2.2.3
4.2.2.4
4.2.2.5
4.2.2.6

Verizon (Reston, VA, US)
================
151.197.0.38
151.197.0.39
151.202.0.84
151.202.0.85
151.202.0.85
151.203.0.84
151.203.0.85
199.45.32.37
199.45.32.38
199.45.32.40
199.45.32.43

Cisco (San Jose, CA, US)
================
64.102.255.44
128.107.241.185