On 13 Dec 2010, at 01:05, Oshan wrote: > recently i wrote a simple program to resolve dns using 'dnspython' module. > it works well. then i converted it to exe using py2exe. > when i execute the exe file it doesn't give the required output.
This is an issue with how py2exe is converting dnspython. The strange looking output in the second image is the generic rdata text format. It looks like you did an MX query in your second example, because the decoded data are the MX RRs for google.com. dnspython dynamically imports modules for rdata types at runtime, and uses the generic rdata class when it can't find a more specialized module. Probably py2exe is not realizing that dnspython needs these modules and is not including them. I know little about py2exe; perhaps there is some way to tell it to import everything in dnspython's dns\rdtypes directory? An easy workaround might be to explicitly import the rdtypes you want to decode, e.g. add import dns.rdtypes.ANY.NS import dns.rdtypes.ANY.MX import dns.rdtypes.ANY.CNAME import dns.rdtypes.IN.A to the top of your script. I included CNAME in the list because dns.resolver.query() needs it to function correctly. /Bob _______________________________________________ dnspython-users mailing list [email protected] http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users
