[Libreoffice] [PATCH] Replace command domainname by getdomainname() on Unix

Lionel Elie Mamane lionel at mamane.lu
Sun Nov 13 05:16:51 PST 2011


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


More information about the LibreOffice mailing list