Hi,

I have just found a wonderful guide of DNS command at : Linux Web Admin Information

DNS Commands

Zone file database records divide DNS information into three primary types: NS (Name Server) records, MX (Mail Exchange) records, and A (Address) records. NS records indicate the name servers. MX records indicate the hosts that handle email delivery; the priority (pri) number indicates the order in which mail servers are used, with the lowest number receiving the highest priority. The A (Address) records map hostnames to IP addresses, the real names of machines.

nslookup

The nslookup program allows the user to query Internet domain name servers interactively or non-interactively

# nslookup
> www.redhat.com
Server: 128.121.247.232
Address: 128.121.247.232#53

Non-authoritative answer:
Name: www.redhat.com
Address: 209.132.177.50
# nslookup www.redhat.com
nslookup interactive options

set querytype=ns

Set the query type to the Name Server record. Future queries of names and IP addresses return the NS record from that host.

set querytype=a
Restore the query type to the Address record.

server server
Make server the default server that is queried.

dig

Use the dig command to determine whether the name server for your domain is configured correctly.

You can quickly determine the Name servers of your host or any other host:
# dig ns your-host.com
Check your (or another) website against the host's name servers:
# dig www.your-domain-name.com @ns.your-host.com
Dig can provide output that is in the same format as the zone file itself. Here is how to get the whole zone file:

# dig any your-domain-name.com
Here are the most useful dig query types: dig any (gathers all DNS information), dig ns (gathers name server information), dig mx (gathers mail exchanger information) and dig a (gathers network address information).

Reverse DNS from command line. Quick and easy way to look up a domain name given an IP address.

# dig -x 192.168.52.2
host

This is the simplest of the DNS commands. It is a quick way to determine the IP address of a hostname.

The host command accepts arguments that are either the fully qualified domain name or the IP address of the server when providing results.

# host <FQDN, domain names, host names, or host numbers>

To perfrom reverse lookup

# host 192.1168.52.2
To find all of the information about a host maintained by the DNS, use the command:

# host -a <domain names >
# host -a redhat.com
# host www.your-domain-name.com

The -a option will return all of the DNS information in verbose format:

Now that you know the IP address for www.your-domain-name.com, try a reverse lookup:

# host <IP address>
To list a complete domain, use the command:

# host -l <domain names>
# host -l redhat.com
dnsquery:

The dnsquery program queries domain name servers via the resolver library calls /etc/resolv.conf.

# dnsquery <host>
# dnsquery www.redhat.com