Re: DNS access
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: DNS access

From: Jp Calderone <exarkun@divmod.com>
Date: Wed Jul 13 2005 - 22:06:06 CEST

On Wed, 13 Jul 2005 15:22:35 -0400, Chris Lambacher <lambacck@computer.org> wrote:
>reverse dns lookup is not really special compared to a regular dns lookup.
>you just need to look up a special name:
>http://www.dnsstuff.com/info/revdns.htm
>
>to format the ip address properly use something like:
>def rev_dns_string(ip_str):
> nums = ip_str.split('.').reverse()
> nums.extend(('in-addr', 'arpa'))
> return '.'.join(nums)
>

It may not be special, but it is different. Reverse DNS uses PTR records, not A records. The site you referenced points this out, too:

"""
Reverse DNS entries are set up with PTR records (whereas standard DNS uses A
records), which look like "25.2.0.192.in-addr.arpa. PTR host.example.com"
(whereas standard DNS would look like "host.example.com. A 192.0.2.25").
"""

Jp
Received on Thu Sep 29 16:56:20 2005