sudo unable to resolve host xxx
2017-12-27 本文已影响25人
D6K
有时候在用sudo执行命令时会出现主机不能解析的警告,虽然可以正常执行,但是看到警告有点不爽,可以在/etc.hosts
文件中将主机名解析回127.0.0.1
即可。
![](https://img.haomeiwen.com/i1900134/23877443a15a3cc5.png)
- 查看主机名
hostname
![](https://img.haomeiwen.com/i1900134/abe86e7ce65b29e8.png)
- 编辑
/etc/hosts
文件添加解析
127.0.0.1 localhost zpp
......
有时候在用sudo执行命令时会出现主机不能解析的警告,虽然可以正常执行,但是看到警告有点不爽,可以在/etc.hosts
文件中将主机名解析回127.0.0.1
即可。
hostname
/etc/hosts
文件添加解析127.0.0.1 localhost zpp
......