My Linux Home Away of Home
Just a site of stuff that I know or claim to. ;-)

DNS Explained – Part 2 (Tools) April 19, 2017

In linux, there are some tools that we use to check what DNS settings that domain name are using. Most linux servers to include Redhat / CentOS / Debian use built in DNS services such as named. The named service is the built in DNS service which control panel such as Plesk and CPanel use to host their DNS settings locally.

Commands Used for DNS Queries:

  • nslookup command – Name Server Lookup Tool for finding the name servers where the zone file is located for the domain you are looking for.




  • dig command – Just using dig with a domain name brings back the IP Address of where the domain lives.





  • whois command – Looks for information about the domain stored at ICANN.





  • host command – The host command is used to do DNS lookups and will convert a domain name to an IP address.









Files used in DNS related queries:


  • /etc/resolv.conf – holds name servers used by server





  • /etc/hosts – holds all host related information. Contains domain names and IP Addresses








Search for domains mail exchanger record:
  • nslookup -type=mx





  • dig mx 





Search for domains A record:
  • nslookup -type=a





  • dig a





Search for domains Name Server record:



  • nslookup -type=ns





  • dig ns





Search for domains CNAME record:



nslookup -type=cname






  • dig cname





Search for domains SPF record:



  • nslookup -type=spf





  • dig spf





List All records for a domain:



  • nslookup -type=any





  • dig any





dig @









When migrating zones from GoDaddy, make sure that everything comes across except for the GoDaddy specific entries i.e. Double or even triple check the information to makes sure that everything needed has been added to the /var/named/ file.
– Verify that all new domains that have been added have the group of named added.
chgrp named /var/named/
– Verify that the named service configuration file does not have errors.
named-checkconf /etc/named.conf
Also check the domain zone files to make sure that there are no errors.
[root@dns01 named]# named-checkzone
zone loaded serial 1389974311
[root@dns01 named]# named-checkzone
zone loaded serial 1389974311
– Reload the named service configuration.
[root@dns01 named]# rndc reload
server reload successful
– Restart the named service.

[root@dns01 named]# service named restart
Stopping named: .                                          [  OK  ]
Starting named:                                            [  OK  ]
– Verify the named service status.
[root@dns01 named]# service named status
version: 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 (Not available)
CPUs found: 2
worker threads: 2
number of zones: 48
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running
named (pid  7264) is running…

[root@dns01 ~]# cat /var/named/
$ttl 300  IN      SOA (
                        38400 )  IN      NS  IN      NS

@                               MX      10
@                               TXT     “v-spf1 a mx ~all”
as                              A
sbam                            A
tc                              A
ald                             A
osi                             A
mx                              A
pd                              A
isi                             A
nald                            A
ldsaving                        A
quasar                          A
sat                             A
conectado                       A
nsb                             A
mlld                            A
lds                             A
ctl                             A
peak                            A
cbs                             A
lld                             A
nlds                            A
dld                             A
dp                              A
bnld                            A
bsa                             A
lda                             A
lcr                             A
ceot                            A
ftp                             CNAME
www                             CNAME

[root@dns01 ~]# cat /var/named/
$ttl 300      IN      SOA (
                        38400 )      IN      NS      IN      NS

boss                          A
legent                       A
peak                          A
quasar                      A
telecircuit                A
ftp                             CNAME
www                         CNAME

A few web sites for troubleshooting
Categories: DNS Information

Leave a Reply

Your email address will not be published. Required fields are marked *