原文地址:http://blog.sina.com.cn/s/blog_669421480102v3bb.html

VMware 中使用网络,对虚拟机设置静态IP:

在Ubuntu中设置静态IP共两步:1>设置IP;2>设置DNS

1>设置IP
    编辑 /etc/network/interface文件:
   
    sudo vi /etc/network/interface

    auto eth0
    iface eth0 inet static              //  指定为静态IP
    address 192.168.0.211         //  IP地址
    netmask 255.255.255.0         //  子网掩码
    gateway 192.168.0.1         //  网关

    配置好后,重启网络
    sudo /etc/init.d/networking restart

#有些文档里有配置网络号和广播地址,这里不配置也没关系

2>设置DNS
    在/etc/resolvconf/resolv.conf.d/目录下新建一个tail文件

    sudo vi /etc/resolvconf/resolv.conf.d/tail

    nameserver 192.168.0.1              // DNS的IP
    nameserver 8.8.8.8             

    保存即可

#直接在/etc/resolv.conf文件中添加DNS,重启后,文件会被重写,原来配置的DNS会消失,

所以我们在/etc/resolvconf/resolv.conf.d/目录下新建一个tail文件,填写需要的DNS服务器便可解决此问题

Ubuntu中设置静态IP和DNS(转载)的更多相关文章

  1. Ubuntu中设置静态IP和DNS

    在Ubuntu中设置静态IP共两步:1>设置IP:2>设置DNS1>设置IP    编辑 /etc/network/interface文件:       sudo vi /etc/n ...

  2. [Ubuntu] 如何设置静态 IP 和 DNS

    编辑 /etc/network/interfaces 来设置 IP 和 DNS 解析服务器: # interfaces() ) and ifdown() auto lo iface lo inet l ...

  3. CentOS7 修改设置静态IP和DNS

    最近因为学习Puppet,用虚拟机装了个CentOS,使用的NAT的网络模式,为了防止再次启动系统的时候网络IP发生变化,因此设置静态IP和DNS. 由于CentOS是最小化安装,没有ifconfig ...

  4. 在linux中设置静态ip地址

    在linux中设置静态ip地址1.在终端中输入:vi /etc/sysconfig/network-scripts/ifcfg-eth0 2.开始编辑,填写ip地址.子网掩码.网关.DNS等[root ...

  5. CentOS7修改设置静态IP和DNS

    当前位置: 主页 > CentOS入门 > 系统配置 > CentOS7修改设置静态IP和DNS 时间:2016-02-22 00:55来源:blog.csdn.net 作者:get ...

  6. linux设置静态IP和DNS以及改网卡名

    ubuntu Ubuntu如果是desktop版,由于desktop版安装了NetworkManager,修改完interfaces文档中的内容,不会生效,需要先修改/etc/NetworkManag ...

  7. 【Ubuntu】设置静态ip地址

    一.Ubuntu16.04设置静态IP1.获取网卡的名字   ip route show 2.获取网卡的名字 vim /etc/network/interfaces auto ens33 iface ...

  8. Ubuntu18.10设置静态IP、DNS、卸载无用软件

    设置静态IP root@xueji:~# vim /etc/network/interfaces # interfaces() ) and ifdown() auto lo iface lo inet ...

  9. ubuntu下设置静态ip

    直接修改系统配置文件ubuntu的网络配置文件是:/etc/network/interfacesubuntu命令行修改网络配置方法前面auto  eth?,让网卡开机自动挂载. 为网卡配置静态IP地址 ...

随机推荐

  1. ansible 学习与实践

    title: ansible 学习与实践 date: 2016-05-06 16:17:28 tags: --- ansible 学习与实践 一 介绍 ansible是新出现的运维工具是基于Pytho ...

  2. document.documentElement和document.body区别

    body是DOM对象里的body子节点,即body标签, documentElement 是整个节点树的根节点root, 详细介绍请看本文,感兴趣的朋友可以参考下   区别: body是DOM对象里的 ...

  3. IE浏览器下a标签嵌套img标签默认带有边框

    最近写在线主页时发现IE浏览器下a标签嵌套img标签默认带有边框: 解决办法:img{border:0 none;} 注意,严格意义上0和none都要加上!

  4. (转)SQL Server 2008怎样编辑200行以上的数据

    刚换SQL Server2008 不久,感觉运行速度.编辑提示都比05版的提升不少,但是在维护考试系统中遇到一个05中没有的问题:05中有“打开表”可以编辑所有数据行,到了08变成了“打开前1000行 ...

  5. tomcat下出现The file is absent or does not have execute&

    启动tomcat出现The file is absent or does not have execute permission... Cannot find bin/catalina.sh The ...

  6. java基础学习----String

    旨在从内存方面看String类的知识点: 1.为何不能被继承(final类) 2.字符拼接时,String类的内存分配问题. 3.String的intern()方法 关于String类经常出现的面试题 ...

  7. CSS的margin塌陷

    一.两个div并列,上面div的margin-bottom和下面div的margin-top会塌陷,也就说会取上面div的margin-bottom和下面div的margin-top的最大值作为两个并 ...

  8. python django学习资料网站

    python module 模块 https://docs.python.org/2.7/py-modindex.html django框架例子 https://docs.djangoproject. ...

  9. android studio如何查看数据库文件

    android studio查看数据库文件有两种方式: 1.SQLSCOUT 优点:集成在as中,功能强大. 缺点:收费,破解麻烦. 2.Android Device Monitor 中的File E ...

  10. C语言的画图(圆形动画)

    #include <stdio.h> #include <malloc.h>#include<graphics.h> #define LEN sizeof(stru ...