On 13 Feb 2009, at 21:37, Shanmuga Rajan wrote:

>
>
> Hi I  am trying to write a simple axfr client. All i need to start a  
> zone transfer and have to count the delegation records for the count.
> I am new to this. So any one of you can help me with this.

#!/usr/bin/env python

# Count the number of NS RRs (other than at the origin)
# in a transferred zone

import dns.query
import dns.zone
import dns.rdatatype

z = dns.zone.from_xfr(dns.query.xfr('10.0.0.1', 'example.'))
total = 0
for (name, rdataset) in z.iterate_rdatasets(dns.rdatatype.NS):
        if name != dns.name.empty:
                total += len(rdataset)
print total

_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users

Reply via email to