Re: hostname как правильно указывать?
В Fri, 26 Feb 2010 23:10:24 +0600
Dmitry Fedorov <dm.fedorov@gmail.com> пишет:
> 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.
Это понятно. Автор поста хочет назначить длинное имя с помощью
# hostname vmware.grid.h-----g.com
Как же тогда будет отрабатывать hostname --fqdn.
В прочем, попробовал:
yuray@keeper:/tmp$ sudo hostname keeper.home.loc
yuray@keeper:/tmp$ hostname --fqdn
keeper.home.loc
yuray@keeper:/tmp$ hostname
keeper.home.loc
yuray@keeper:/tmp$ hostname -d
home.loc
Глотает гад.
--
Best Regards,
Yuri Kozlov
Reply to: