![Beim Ausführen von „hostname -i“ werden nicht mehr alle meine Adressen angezeigt](https://rvso.com/image/885957/Beim%20Ausf%C3%BChren%20von%20%E2%80%9Ehostname%20-i%E2%80%9C%20werden%20nicht%20mehr%20alle%20meine%20Adressen%20angezeigt.png)
Ich habe meinen Hostnamen auf Ubuntu 16.04.1 geändert.
Beim Ausführen werden jetzt hostname -i
die meisten meiner Adressen bis auf eine gelöscht.
Stattdessen lautet die Ausgabe:
127.0.1.1
Ich war: ipv6_address%eth0 ipv6_address%eth1 ipv6_address%2 ipv4_address ipv4_address ipv4_address ipv4_address
.
/etc/Hostname: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
Gibt es eine Möglichkeit, meine Adressen zurückzubekommen?
Antwort1
Dies liegt daran, dass /etc/hosts
Sie in den Eintrag finden 127.0.1.1 YourLinuxBoxName
.
Dieser spezielle Localhost-Eintrag (jede Adresse in 127/8
ist localhost
) wird von DNSmasq verwendet. Er kann ignoriert werden.
Antwort2
Sie sollten die nächste Zeile ändern:
127.0.1.1 rany-01 rany-01
in /etc/hosts
. Es muss sein:
127.0.1.1 ubuntu-rany-01
Oder Sie ändern den Inhalt von /etc/hostname
: rany-01
anstelle von ubuntu-rany-01
.