Re: FQDN vs. domain in /etc/hosts
Chris Davies a écrit :
> Stefan Schmidt <stefan.schmidt@gmx.net> wrote:
>> in my understanding the /etc/hosts file should contain an entry with the
>> FQDN of the host.
>
>> 123.123.123.123 hostname.domain.tld hostname
>
> Yes, that's right.
>
>
>> I would for simplicity prefer to use a domain name instead of a FQDN.
>> 123.123.123.123 domain.tld hostname
>
> Fine.
>
>
>> So both addresses are unambiguous. For what reason now would I need a
>> FQDN? Why wouldn't a domain name suffice?
>
> Typically, I see it that a domain refers to an entity, whereas a FQDN refers to a host or service within that entity. For your purposes the following sdhould be sufficient:
>
domain.tld is a FQDN if "tld" is a valid tld. a domain is fqdn if it
contains all labels until the top domain. same as for an absolute path
(aka /tld/domain). in dns terms, fqdn ends with a dot though.
now, I don't see why Stefan wants to do that...
> 127.0.0.1 localhost
> 123.123.123.123 hostname.domain.tld hostname domain.tld
>
> When resolving from name to IP, the first match will succeed. When
> resolving from IP to name, the leftmost entry on the first line will be
> considered the canonical name (hostname.domain.tld in this case).
>
Reply to: