"hostname -i"를 실행하면 더 이상 모든 주소가 표시되지 않습니다.

"hostname -i"를 실행하면 더 이상 모든 주소가 표시되지 않습니다.

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/호스트:

# 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) localhost은 DNSmasq에서 사용됩니다. 무시해도 안전합니다.

답변2

다음 줄을 변경해야 합니다.

127.0.1.1 rany-01 rany-01

안에 /etc/hosts. 다음과 같아야 합니다.

127.0.1.1 ubuntu-rany-01

또는 대신 /etc/hostname: 의 내용을 변경할 수 있습니다 .rany-01ubuntu-rany-01

관련 정보