- Subject: Re: gethostbyname () causing irritating delays
- From: "John E. Davis" <davis>
- Date: Thu, 2 May 2002 23:04:14 -0400
Ethan Blanton <eblanton@xxxxxxxxxxxx> wrote:
>I realize that it is due to my hostname not being in /etc/hosts; I am
>currently solving this problem by hardcoding my hostname to a bogus
>example.org address and putting that hostname in /etc/hosts. The setup in
>question, however, is on a laptop that often roams networks and should (in
>order for everything to work "properly") be getting its current hostname
>from, e.g. DHCP. If I roam to a network and get a valid hostname via DHCP
>and then, say, the router goes down, I get these delays.
I do not think there will be any conflicts between the random hostname
assigned to your laptop by the DHCP server and the hard-coded name in
your hosts file--- unless you choose a name that is already on the
local network and you have to interact with that machine by name.
>Granted, I could put all of those hostnames in /etc/hosts as I get them, but
>I am often on networks with hostnames I cannot expect ahead of time, and
>this is somewhat irritating.
Again, I do not think that the hostname assigned to you by the server
is important.
>My gut feeling is that the Right Solution is for gethostname () to return
>the correct value (i.e. hostname should be used to set the FQDN), rather
>than depending on a gethostbyname () for said lookup. That said, it ain't
>my editor. ;-)
Here is how jed determines the hostname:
1. If JED_HOSTNAME is defined during compile-time, it uses that
value.
2. If gethostname returns a FQDN, it uses it.
3. Otherwise gethostbyname is used to determine the FQDN.
--John
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2002 date index]
[2002 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]