When converting from zone file
zone = dns.zone.from_file(file_name,origin='example.com',relativize=False)
records = zone.iterate_rdatas(MX)
for (name, ttl, rdata) in records:
print('<Name>%s</Name>' % (name))
This works great UNLESS the zone file looks like this:
IN MX 10 ASPMX.L.GOOGLE.COM.
flag IN MX 10 flag.me.
IN MX 20 ALT1.ASPMX.L.GOOGLE.COM.
IN MX 20 ALT2.ASPMX.L.GOOGLE.COM.
IN MX 30 ASPMX2.GOOGLEMAIL.COM.
IN MX 30 ASPMX3.GOOGLEMAIL.COM.
IN MX 30 ASPMX4.GOOGLEMAIL.COM.
IN MX 30 ASPMX5.GOOGLEMAIL.COM.
this results in an output like this:
<Name>flag.example.com.</Name>
<Name>flag.example.com.</Name>
<Name>flag.example.com.</Name>
<Name>flag.example.com.</Name>
<Name>flag.example.com.</Name>
<Name>flag.example.com.</Name>
<Name>flag.example.com.</Name>
<Name>example.com.</Name>
As you can see one value returns ok however the other inherit the 'flag'
part of the record
Richard Harvey
~~~~~~~~~~~
http://dev.squarecows.com
B9A6 97CD 5941 9EC2 45F4
BCF2 961E DD64 9D0F CA37
_______________________________________________
dnspython-bugs mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-bugs