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: Chris Lambacher <lambacck@computer.org>
Date: Wed Jul 13 2005 - 21:22:35 CEST

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)

-Chris

On Wed, Jul 13, 2005 at 07:44:41AM -0700, laksh wrote:
> im looking for some advice regarding DNS lookup using python
>
> is it possible to give parameters like the IP of a DNS server and the
> DNS query to a python program and obtain the response from the DNS
> server ?
>
> please reply if u hav some idea or interest
>
> laksh
>
> --
> http://mail.python.org/mailman/listinfo/python-list
Received on Thu Sep 29 16:56:18 2005