Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Sun, Nov 13, 2011 at 12:06:52PM +0200, Tor Lillqvist wrote:

The portable and strictly correct way seems to be to do a
DNS query on the result of gethostname() (gethostbyname or getaddrinfo
with AI_CANONNAME).

But in general we should avoid potentially pointless DNS calls. Let's
not risk having to wait for DNS timeouts in badly configured
situations. (...)

Especially as many "home" end-user machines certainly don't have any
public official DNS name anyway, at least not one the machine itself
would know, but some cable-modem-42651e7a3c.isp.example.com.

AFAIK, a well-configured machine has /etc/hosts setup so that
gethostbyname(gothostname()) does not touch DNS, but is resolved
entirely from reading /etc/hosts. Doesn't the installer *by* *default*
set things up like that? At least, the Debian installer does.

This does not help with "badly configured situations", indeed :-|

-- 
Lionel

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.