[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: where does `hostname -f` derive the domainname from?



On 2022-06-26 21:07:13 +0000, tuxifan@posteo.de wrote:
> I checked using strace and it's appearently going through the following:
> 
> 1. uname

This is due to the call to gethostname(), as seen with "hostname"
without any option.

The following is due to the call to getaddrinfo() on the node name
and depends on the system.

> 2. /run/nscd/socket

I don't have that. You may have nscd or unscd installed.

> 3. /etc/nsswitch.conf

I suppose that this is usual.

> 4. /etc/resolv.conf
> 5. /etc/hosts

I think that both are read because getaddrinfo() does more than
what is actually needed for "hostname -f" (only /etc/hosts should
be sufficient with a usual configuration).

On my machine, there's also "/etc/host.conf".

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: