fully qualified hostname ?

Ted Horst Ted.Horst at wdr.com
Thu Aug 26 17:03:54 EDT 1999


Thanks for the rapid response!

On 26 Aug 1999, claird at starbase.neosoft.com (Cameron Laird) wrote:
> In article <199908261822.AA01099 at ch1d2833nwk>,
> Ted Horst  <Ted.Horst at wdr.com> wrote:
> >
> >What is the best way to get the fully qualified hostname in python (ie
> >hostname.domainname) ?
> >
> >A portable solution would be ideal, but I would settle for Unix only.
> .
> .
> .
> There's a lot of ambiguity in the question of which
> you're not aware.  A perfectly well-behaved network
> host might have several fully-qualified hostnames,
> or none.  One can even make a case that a single
> host is best known by different names on different
> ports.
>

OK, I can see that.  If there are multiple valid choices (meaning that they  
would resolve ok outside of my domain), then I don't think I care which one  
I get.

> So:  you're definitely entering the land of some-
> what sloppy heuristics.  The first thought that
> occurs to me is a reverse DNS lookup; is that ade-
> quate to your situation?

That sounds reasonable to me, but this is not really my area of expertise.   
How would I do this from python ?

>
> Note, also, that many Python instances run on host-
> nameless hosts.

The context here is distributed objects, CORBA for now.  So how would you  
encode the host for inclusion in an IOR if there is no hostname ?

> --
>
> Cameron Laird           <http://starbase.neosoft.com/~claird/home.html
> claird at NeoSoft.com      +1 281 996 8546 FAX
>
> --
> <http://www.python.org/mailman/listinfo/python-list
---




More information about the Python-list mailing list