Finding mail exchangers

Steve Holden sholden at holdenweb.com
Tue May 14 00:57:04 EDT 2002


"Anthony Baxter" <anthony at interlink.com.au> wrote in message
news:mailman.1021348163.24212.python-list at python.org...
>
> >>> "Steve Holden" wrote
> > You need to submit a query to a DNS server and decode the reply.
>
> Look at the code in pydns.sf.net - there's a function in the lazy module
> called "mxlookup". For instance,
>
> >>> import DNS
> >>> DNS.DiscoverNameServers()  # win or unix, initialise resolver.
> >>> DNS.mxlookup('interlink.com.au')
> [(0, 'mx1.interlink.com.au'), (50, 'mx2.interlink.com.au')]
>
Sounds like the perfect solution - I'll suggest that instead of my own hack
in future.

> > I have code that does this if you'd like a copy (it uses the dnslib
code,
> > which I can also provide).
>
> How does your dnslib differ from Guido's original code?

At this distance in time it's hard to say. Probably not at all, but there
was a time when dnslib wasn't always distributed.

Anyhway, since we seem to be in an ongoing problem solved situation, thanks
for the information.

regards
 Steve
--
-----------------------------------------------------------------------
Steve Holden                                 http://www.holdenweb.com/
Python Web Programming                http://pydish.holdenweb.com/pwp/
-----------------------------------------------------------------------








More information about the Python-list mailing list