[lug] Converting IPs to Domain Names and Vice Versa via Bash

David Morris lists at morris-clan.net
Wed Jan 26 17:49:48 MST 2005


On Wed, Jan 26, 2005 at 05:33:30PM -0700, David Morris wrote:
> On Wed, Jan 26, 2005 at 05:38:42PM -0700, Bill Thoen wrote:
> > 
> > For grins, I tried this but don't understand the results. Check this out.
> > One IP resolves to two different domains. Then looking up each of those
> > domains separately I get different IPs from the one I started with. What's
> > going on?
> 
> Welcome to the land of DNS and all its confusing tangle of
> nightmares. =D
> 
> Ordinarily a hostname can be mapped to any number of IP
> addresses but an IP address can be mapped to only one
> hostname.  This is why you are getting a different IP
> address on the forward lookup than on the reverse lookup.
> Use 'host -a <whatever>' to get a more detailed report.

I just realized I forgot a vital piece of information:

DNS entries mapping IP addresses to a hostnames are managed
completely sepperately from the mapping from hostnames to IP
addresses.  If the admin for the domain is sloppy/stupid
they might not match.

--David




More information about the LUG mailing list