Martin Pieuchot wrote:
> When my machine doesn't get a reply from a DNS server, generally the
> wifi router of the place where I'm drinking coffee, applications sit
> in gethostbyname(3) "indefinitely".  At least too long for me to wait
> and I end up killing the app.

We used to add an entry for the machine's hostname to /etc/hosts, but this
lead to other problems and was removed some years ago I believe.

Personally, I think it's a likely bug for software to resolve local hostname.
You already know the hostname, it's just gethostname(), and if you really need
to know the IP, it's in ifconfig, etc., but there's no reason to believe
there's only one IP or that other machines will know that this system has this
name.

Reply via email to