怪哉怪哉, 大debian突然就出现了这个问题 , 问题的现象是只要使用 sudo 执行命令就会出现 sudo unable to resolve host </etc/hostname中的内容>.

去网上一搜, 出现此类问题的还真不少, 但是感觉他们的解决方法都是没有找到问题的根源.

网上普遍的解决方法是这样的,

在 /etc/hosts 中添加对 /etc/hostname 中设置的主机名的解析.

试了一下, 有效, 将主机名改成 localhost 也有效. 但是天地良心啊, 我之前没动过 /etc/hosts 这个文件啊. 又看了一下我的CentOS7, /etc/hosts 文件中也没有对主机名的解析啊, 可是人家执行sudo 很正常.

在出现这个问题之前我安装卸载过 nginx, 但实在想不通为什么会导致这个问题.

[待解决] sudo unable to resolve host的更多相关文章

  1. sudo: unable to resolve host xxx解决办法

    问题: root@wiki:~# sudo lsb_release -a sudo: unable to resolve host wiki No LSB modules are available. ...

  2. sudo: unable to resolve host XXX 解决方法

    执行sudo命令时候,总是提示sudo: unable to resolve host xxx 解决方法: 法1. 在/etc/hosts/添加hosts映射, 如127.0.0.1 xxx 法2. ...

  3. 出现 sudo: unable to resolve host XXX 信息解决办法

    Ubuntu环境,  每次执行sudo 就出现这个警告讯息:sudo: unable to resolve host XXX虽然sudo 还是可以正常执行,是机器在反解上的问题, 所以就直接从/etc ...

  4. Ubuntu 报错 sudo: unable to resolve host

    Ubuntu 在每次执行命令的时候,会报如下错误: $ sudo sudo: unable to resolve host iZ2zecsdy8flu603bmdg1bZ iZ2zecsdy8flu6 ...

  5. 一组相关联的问题:“sudo: unable to resolve host ###: Connection timed out”、软件启动速度超慢、IPv6无法使用

    造冰箱的大熊猫@cnblogs 2018/9/15 近日陆续发现计算机出现几个问题,最终发现这些问题实际上是由同一个原因导致的 问题1:无法使用IPv6 问题2:无论是启动Emacs GUI还是在命令 ...

  6. sudo: unable to resolve host ubuntu提示的解决

    http://blog.sina.com.cn/s/blog_6c9d65a1010180mg.html

  7. sudo: unable to resolve host 枝桠

    Ubuntu环境, 主机名字叫枝桠(机器的hostname), 每次执行sudo 就出现这个警告讯息: 虽然sudo 还是可以正常执行, 所以就直接从/etc/hosts 设定, 让枝桠(hostna ...

  8. sudo: unable to resolve host myhostname: Connection timed out

    第一种 原因,/etc/hostname 中的hostname 与/etc/hosts 里面的不对应,导致无法解析 将两个文件的hostname改成一样的即可. /etc/hostname aaa / ...

  9. Ubuntu sudo 出现unable to resolve host 解决方法

    Ubuntu sudo 出现unable to resolve host 解决方法 Ubuntu环境, 假设这台机器名字叫abc(机器的hostname), 每次执行sudo 就出现这个警告讯息: s ...

随机推荐

  1. ASP.NET Web API与Rest web api(一)

    HTTP is not just for serving up web pages. It is also a powerful platform for building APIs that exp ...

  2. GIS 学习及参考站点

    地理信息论坛 GIS空间站 GISALL 广东水利厅 flex版的

  3. linux root不能用

    在操作查看vi /etc/passwd 查看用户信息时,不小心修改了root的用户名改成了eoot,这样在切换到普通用户后,就切不回root,即使明明知道用户名是eoot,也知道原来的root密码,但 ...

  4. iOS7 修改导航系统默认返回按钮文字及颜色

    //iOS7 修改系统默认返回按钮文字及颜色 UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"返" ...

  5. table_tricks_基于bootstrap

    <!DOCTYPE html><html><head> <title>Bootstrap 实例 - 基本表单</title> <lin ...

  6. 热门WEB前端职业你只需要掌握这些

    在知名的互联网企业里工作是一件很美好的事情,有很多的工作机会,而且企业们通过高薪以及令人羡慕的福利来争夺最优秀的人才.但是如果你花了大量的时间在招聘网站上和公司的帖子上,你可能会注意到在网页设计这个工 ...

  7. UIKit结构图

  8. 在一个Label上设置多种颜色字体

    #import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL ...

  9. Permissions 0664 for '/home/root/.ssh/id_rsa' are too open.

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY @ @@@ ...

  10. Array.prototype.slice && Array.prototype.splice 用法阐述

    目的 对于这两个数组操作接口,由于不理解, 往往被误用, 或者不知道如何使用.本文尝试给出容易理解的阐述. 数组 什么是数组? 数组是一个基本的数据结构, 是一个在内存中依照线性方式组织元素的方式, ...