Home > DNS and BIND > Useful DNS Commands

Useful DNS Commands

October 7th, 2009

host

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 domain, 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

The dig command can also do reverse lookups with output formatted for the zone file:
Code:
dig -x <IP Address>

DNS and BIND

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.