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

Re: Fwd: /etc/hosts and resolving of the local host/domainname - vs.

On Mon, 5 Aug 2013 13:08:28 -0400, Thomas Hood wrote:

(I had an exchange of emails with Thomas off-list and he suggested that I reply on-list.)

> With the nsswitch configuration
> hosts: files ... dns ... myhostname
> myhostname resolves the system hostname if nothing else does so
> first. So it can be overridden either by DNS or by /etc/hosts. If
> the system hostname changes, no file has to be edited. Nice.
> Also nice is the fact that myhostname resolves the system hostname
> to an external address if there is one, increasing the chances that
> the result is similar to what would be obtained from DNS.

The output below is from Debian Sid with libnss-myhostname installed
and Fedora 19.

On Debian, getent outputs the system's IP address for,
whereas on Fedora, getent outputs for

Debian Sid

[root@debdeb:/etc]# cat hostname

[root@debdeb:/etc]# cat hosts localhost

[root@debdeb:/etc]# getent hosts   debdeb

Fedora 19

[root@fedfed:/etc]# cat hostname

[root@fedfed:/etc]# cat hosts localhost

[root@fedfed:/etc]# getent hosts       fedfed.defdef

Reply to: