关于这个问题,我查询了大量的文章,都指向了 /etc/hosts
文件。
但是,我的 /etc/hosts
文件已经包含了如下内容:
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
localhost
已经设置过了,真是让人蛋疼。。。
于是,我搜索了一下 localhost.localdomain
到底是什么,原来是和 localhost
一样的东西,只是名称不同。
所以我把 localhost.localdomain
也加入到了 /etc/hosts
文件中,如下:
127.0.0.1 localhost.localdomain localhost
问题解决!