This is the simplest of the DNS commands. It is a quick way to determine the IP address of a hostname:
Code:
:~$ host www.your-domain-name.com
The -a option will return all of the DNS information in verbose format:
Code:
:~$ host -a www.your-domain-name.com
Now that you know the IP address for www.your-domain-name.com, try a reverse lookup:
Code:
:~$ host <IP address>
dig (domain information groper)
This command gathers and returns DNS information in a format the name server can use directly. You will find it easy to query specific name servers with dig.
You can quickly determine the Name servers of your host or any other host:
Code:
:~$ dig ns your-host.com
Then you check your (or another) website against the host's name servers:
Code:
:~$ 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:
Code:
:~$ 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).
The dig command can also do reverse lookups with output formatted for the zone file:
Code:
:~$ dig -x <IP Address>
Bookmarks