Ubuntu系统的Hosts只需修改/etc/hosts文件,在目录中还有一个hosts.conf文件,刚开始还以为只需要修改这个就可以了,结果发现是需要修改hosts。修改完之后要重启网络。
具体过程如下:
1、修改hosts
sudo gedit /etc/hosts
2、添加解析记录( . )
完整案例:127.0.0.1 localhost.localdomain localhost
简洁记录:127.0.0.1 localhost
3、保存后重启网络
sudo /etc/init.d/networking restart

Ubuntu 修改host并重启网络的更多相关文章

  1. Ubuntu虚拟机中断后重启网络断接错误解决方案

    因为该死的windows自动更新,所以vmplayer经常会被强制关闭. 但重新启动后,会发生不能连接到网络的情况显示: waiting for the network configuration…… ...

  2. ubuntu 下修改host文件

    原文地址:http://www.cnblogs.com/kingcat/archive/2012/02/23/2364509.html 有些时候,我们需要让某些域名指向本地,来实现调试,下面介绍下ub ...

  3. ubuntu系统下如何修改host

    Ubuntu系统的Hosts只需修改/etc/hosts文件,在目录中还有一个hosts.conf文件,刚开始还以为只需要修改这个就可以了,结果发现是需要修改hosts.修改完之后要重启网络.具体过程 ...

  4. Ubuntu 16.04修改MAC地址以及网络常用设置(IP/DNS/网关)

    1.先停止桌面版自带的NetworkManager,这东西很难用,且有些设置需要重启. sudo systemctl stop NetworkManager.service sudo systemct ...

  5. ubuntu重启网络报错

    执行:gw@ubuntu:/$ /etc/init.d/networking restart 报错:stop: Rejected send message, 1 matched rules; type ...

  6. Ubuntu重启网络/etc/init.d/networking restart报错

    Linux版本:Ubuntu 12.04 配置网口后重启网络,提示/etc/init.d/networking restart is deprecated. $ sudo /etc/init.d/ne ...

  7. ubuntu 重启网络方法--通过杀死进程重启网络

    重启网络方法(通过杀死进程方式,达到网络重启) zh@zh:~$sudo NetworkManager restart //查看进程idNetworkManager 已正运行(pid 10254)zh ...

  8. ubuntu, 修改hosts文件

    介绍下ubuntu下修改host实现域名指向本地的方法. Ubuntu系统的Hosts只需修改/etc/hosts文件,在目录中还有一个hosts.conf文件,刚开始还以为只需要修改这个就可以了,结 ...

  9. Ubuntu 修改hosts

    Ubuntu系统的Hosts只需修改/etc/hosts文件,在目录中还有一个hosts.conf文件,刚开始还以为只需要修改这个就可以了,结果发现是需要修改hosts.修改完之后要重启网络.具体过程 ...

随机推荐

  1. Ubuntu——Python3.x——scikit-learn 安装

    修改默认Python (默认的是Python2.7) rm -rf /usr/bin/python ln -s /usr/bin/ptyhon3 /usr/bin/python 安装所需依赖: apt ...

  2. 修改eclipse中的propersties文件的默认编码格式

    最近遇到每次新建工程里无论在总得工程设置了utf-8还是刚刚建立的空间设置都没有效果, 原来properties文件的设置要单独弄,如下图所示

  3. Jasper-template

    ylbtech-Jasper: 1.返回顶部   2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部     6.返回顶部   作者:ylbtech出处:http://ylbtech. ...

  4. lwip 移植

    一.源码目录结构 api . core.netif. include core下又有IPV4 . IPV6 . SNMP 和.c文件 include下又有IPV4.IPV6.LWIP.netif ne ...

  5. Apache2.2安装图解

    Apache2.2安装图解 2010-12-14 15:32:44|  分类: 不学无术之杂 |  标签:安装  端口  httpd  apache2.2  服务器   |字号 订阅 Apache音译 ...

  6. 使用VSTO写的一个工作证打印软件

    转行做HR近2年.最近公司要做工牌,工牌上要打印照片,姓名,工号和部门等信息.一共1000多人,如果手工排版手工打印的话,估计要死人. 于是coding的老毛病又犯了,想写个程序来打印工牌.还是拿最近 ...

  7. oracle查看监听状态

    产看状态命令:lsnrctl status 启动监听:lsnrctl start 关闭监听:lsnrctl stop LSNRCTL for 32-bit Windows: Version 10.2. ...

  8. [poj] Catch That Cow--bfs

    Description Farmer John has been informed of the location of a fugitive cow and wants to catch her i ...

  9. opengl学习资料

    opengl新手指引 https://www.codeproject.com/articles/771225/learning-modern-opengl Learning Modern 3D Gra ...

  10. How to generate a CSR in Microsoft IIS 7

    How to generate a CSR in Microsoft IIS 7 To help you generate your CSR for Microsoft IIS 7 we've pre ...