Re: hostname как правильно указывать?
26 февраля 2010 г. 22:16 пользователь Yuri Kozlov написал:
> Denis Feklushkin пишет:
>
>> можно было бы прописывать fqdn и не париться, хотя это и не удобно, но
>> всё дело в том что в man hostname есть такая строчка: "/etc/hostname
>> This file should only contain domain name and not the full FQDN"
>
> Это про то, что в файле, а не про то, что должно отдаваться по hostname.
>
> Если написать длинное, то что будет отдаваться при hostname --fqdn?
Дочитайте man hostname до конца:
THE FQDN
You can't change the FQDN (as returned by host-
name --fqdn) or the DNS domain name (as returned
by dnsdomainname) with this command. The FQDN of
the system is the name that the resolver(3)
returns for the host name.
Technically: The FQDN is the name getaddrinfo(3)
returns for the host name returned by gethost-
name(2). The DNS domain name is the part after
the first dot.
Therefore it depends on the configuration (usu-
ally in /etc/host.conf) how you can change it.
Usually (if the hosts file is parsed before DNS
or NIS) you can change it in /etc/hosts.
В простом случае, если хотите нужный вам fqdn,
пропишите его в /etc/hosts поближе к началу,
сразу после localhost.
Reply to: