Hi.

I need to try to write a simple xfr client, which i am gonna use it to count
resource records of  TLD zones.
I wrote a simple xfr client code..... here is my code....

# zone_list    contains list of zones for xfr details
# dns_server contains BIND or NSD ip

for xtld_zone in zone_list:

    try:
        z = dns.zone.from_xfr(dns.query.xfr(dns_server,tld_zone))  # this
dns.query.xfr will return a generator, we are converting it to a generator.
        # if ns record then

        total = 0
        ns_record = []
        for (name, rdataset) in z.iterate_rdatasets(dns.rdatatype.ANY):
                   if name != dns.name.empty:
                           total += len(rdataset)

    except BadResponse:
        # handle exception
    except UnexpectedSource:
        # handle exception



but i want to know,  is there any other better way to do this.?
if its can you explain me.


Thanks and Regards,

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

Reply via email to