[Pythonmac-SIG] socket.gethostbyaddr(socket.gethostname())

tmk tmk@easynet.be
Wed, 16 Aug 2000 23:13:55 +0200

> From: Jack Jansen <jack@oratrix.nl>
> Date: Wed, 16 Aug 2000 12:38:27 +0200
> To: "tmk [microscript]" <tmk@microscript.be>
> Cc: Python Mac mailing list <pythonmac-sig@python.org>
> Subject: Re: [Pythonmac-SIG] socket.gethostbyaddr(socket.gethostname())
>> Yo,
>> I'm finding that the call socket.gethostbyaddr(socket.gethostname()) (called
>> all over the place in smtplib for example) generates an error (host not
>> found) when the machine it's executed on doesn't have a DNS IP address
>> reverse mapping PTR record (this record allows fo the reverse mapping from
>> an IP address to a host name).
> Well, the relevant internet standards speficially say that you _must_ have a
> PTR record for all machines. But, the fact that I get 3 messages a week from
> people who can't access ftp.cwi.nl shows that a lot of ISPs indeed happily
> ignore this:-(

Thanks for the correction Jack. Since I do have access to my DNS I could
work around this "feature" :-/.

> The solution is to add the PTR (and A, of course) record for your own machine
> to your hosts file.

I didn't know that the subset of features the  Hosts file supports did
include PTR record... I've dl'ed the OT FAQ version 2.3 and it seems to
mention that the only record classes supported are A, CNAME and NS :-(. I'll
test to see if PTR are nevertheless supported.

<ftp://seeding.apple.com//ess/public/opentransport/OT_QA_folder/OT Q%26A

> And, on smtplib: again by the standard it should pass the official name (fqdn)
> in the HELO command. It might be allowable, though, to pass [xx.xx.xx.xx] or
> so (rfc821 is a long time ago, I don't remember).

I've tested this and with and most  smtp server will accept happilly accept
anything (e.g 'fubar'...)

= tmk =

> --
> Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
> Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
> www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm