Spacer http://macenterprise.org MacResource.org - Mac OS X enterprise deployment project Spacer
Site Map Contact Us Site Map About Us Top Background
 
Search
 
 
Testing forward and reverse DNS E-mail
Written by Philip Rinehart   
Tuesday, 17 April 2007
Testing forward and reverse DNS is one of the common troubleshooting steps with Directory Services.

Often, nslookup or dig is the tool of choice to test the forward and reverse DNS lookup functionality.  As a quick review, forward DNS is the translation of and a given hostname to it's corresponding IP address, while reverse DNS is the translation of an IP address to its corresponding hostname.  Rather than using nslookup, the host command can be used instead, which is much faster and simpler.  Here' how:

 To test forward DNS

host hostname

Generally, the return value should be:

hostname has address 1.2.3.4

Testing reverse DNS follows the same form:

host 1.2.3.4

The return value should be similar to the following:

4.3.2.1.in-addr.arpa domain name pointer hostname 

 Notice the reverse IP address in the return value.  If both of these commands return information, forward and reverse DNS is working.


Add as favourites (223) | Quote this article on your site | E-mail

Comments (3)
RSS comments
1. 24-04-2007 11:37
host 1.2.3.4 
 
returns 
 
4.3.2.1.in-addr.arpa domain name pointer fully.qualified.hostname. 
 
note the trailing period. On the forward lookup, all three lookups: 
 
host hostname 
host fully.qualified.hostname 
host fully.qualified.hostname. 
 
all return the IP address.
Douglas Gauck
2. 26-04-2007 12:04
Is there any disadvantage to using host vs. lookupd? I thought that lookupd was the best way to test DNS because you are going through the same processes as the Mac OS itself. dig and nslookups can return false positives because they go direct to the external DNS server and do not reference the RAM cache or local files, e.g. /etc/hosts. There was a significant bug in an earlier version of Mac OS X which relates to this.
Andrew McNaughton
3. 27-04-2007 13:47
Excellent point. You are right, that lookupd is the way to test client connectivity. Host is a very quick check of DNS, while lookupd is clearly more thorough.
Philip Rinehart

Only registered users can write comments.
Please login or register.

Powered by AkoComment Tweaked Special Edition v.1.4.4

Last Updated ( Thursday, 03 January 2008 )
 
< Prev   Next >