- 问题:使用sudo就会出现unable to resolve host xxx(xxx为主机名)
- 原因:在/etc/hostname文件中修改了主机名,但是未在/etc/hosts这个文件中同步更改主机名
sudo gedit /etc/hosts
/etc/hosts文件内容为
127.0.0.1 localhost
127.0.1.1 yyy
# 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
- 解决:只需要将/etc/hosts文件中的yyy改为xxx即可。
评论(1)
您还未登录,请登录后发表或查看评论