![Запуск «hostname -i» больше не отображает все мои адреса](https://rvso.com/image/885957/%D0%97%D0%B0%D0%BF%D1%83%D1%81%D0%BA%20%C2%ABhostname%20-i%C2%BB%20%D0%B1%D0%BE%D0%BB%D1%8C%D1%88%D0%B5%20%D0%BD%D0%B5%20%D0%BE%D1%82%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B0%D0%B5%D1%82%20%D0%B2%D1%81%D0%B5%20%D0%BC%D0%BE%D0%B8%20%D0%B0%D0%B4%D1%80%D0%B5%D1%81%D0%B0.png)
Я изменил имя хоста в Ubuntu 16.04.1.
Теперь бег hostname -i
избавляет меня от большинства адресов, за исключением одного.
Вместо этого вывод будет таким:
127.0.1.1
Это было: ipv6_address%eth0 ipv6_address%eth1 ipv6_address%2 ipv4_address ipv4_address ipv4_address ipv4_address
.
/etc/имя_хоста:ubuntu-rany-01
/etc/hosts:
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
#
127.0.1.1 rany-01 rany-01
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Можно ли как-то вернуть мои адреса?
решение1
Это потому, что в /etc/hosts
вы находите запись 127.0.1.1 YourLinuxBoxName
.
Эта конкретная запись localhost (каждый адрес в 127/8
is localhost
) используется DNSmasq. Ее можно смело игнорировать.
решение2
Вам следует изменить следующую строку:
127.0.1.1 rany-01 rany-01
в /etc/hosts
. Это должно быть:
127.0.1.1 ubuntu-rany-01
Или вы можете изменить содержимое /etc/hostname
: rany-01
вместо ubuntu-rany-01
.