Ubuntu 12.04 Server 不建議以手動更改『/etc/resolv.conf』 的方式指定 Name Server,
max@riyu:~$ sudo cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN |
就算是手動在『/etc/resolv.conf』 指定 Name Server , 重開機之後你所作的變更也會被覆寫掉。
如果需要指定 Name Server , 可以在『/etc/network/interfaces』設定檔中以
『dns-nameservers』這個指令來指定。
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp # 在最後加入下列設定 dns-nameservers 8.8.8.8 168.95.192.1 168.95.1.1 auto eth1 iface eth1 inet static address 1.2.3.4 netmask 255.255.255.0 gateway 3.4.5.6 #設定為固定IP的界面也是一樣 dns-nameservers 8.8.8.8 168.95.192.1 168.95.1.1 auto br0 iface br0 inet static bridge_ports eth2 address 3.4.5.6 netmask 255.128.0.0 gateway 7.8.9.10 #如果設定了橋接器,就加在橋接器界面設定的最後一行 dns-nameservers 8.8.8.8 168.95.192.1 168.95.1.1 |
重新起動網路服務後, 在『/etc/network/interfaces』設定檔中所指定的 Name Server , 會被寫入到『/etc/resolv.conf』中。
不同的 interface可以給予不同的設定,不過最後在寫入到『/etc/resolv.conf』時會將之合併,同時,會依據在『/etc/network/interfaces』所設定的 Name Server 先後順序決定 DNS 解析順位。
root@riyu:~# cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 8.8.8.8 nameserver 168.95.192.1 nameserver 168.95.1.1 |
相关推荐
Ubuntu Server 12.04安装图解,附件中为安装过程中全部截图,可按照图中所选择部分安装
ubuntu 1204 server guide
Ubuntu12.04 nginx python uwsgi Django安装步骤
ubuntu12.04 server版本,虚拟机共享宿主机的无线网上网,亲测,有图。
zabbix2.03在ubuntu12.04上的安装(最新)
Ubuntu 12.04 菜鸟完全使用教程让你用最快的速度熟悉使用Ubuntu 12.04!
libc6 for ubuntu 12.04 所有依赖的库都打包 .
Ubuntu12.04菜鸟使用手册合集+Ubuntu标准教程Ubuntu12.04菜鸟使用手册合集+Ubuntu标准教程Ubuntu12.04菜鸟使用手册合集+Ubuntu标准教程Ubuntu12.04菜鸟使用手册合集+Ubuntu标准教程Ubuntu12.04菜鸟使用手册合集+...
Ubuntu 12.04下如何安装MySQL ,我按照这文档,已经成功在ubuntu 12.04安装成功mysql!
用 VMware 安装 Ubuntu 12.04详细过程图解
最全,最好用 自己试试啊ubuntu12.04 vim 配置
ubuntu 12.04 svn server 配置, 个人配置记录分享
在ubuntu12.04下可以通过这个主题包快速的安装苹果mac主题,我自己也正在用这个主题,分享给大家。
这是Ubuntu操作系统12.04的一些使用指导,和大家分享一下。
ubuntu12.04安装及配置过程详解
ubuntu12.04下Java开发环境的搭建
在ubuntu 12.04 上完成的git服务器搭建步骤。
详细描述了ubuntu12.04版本的使用,对于linux的详细学习还是要看书
适逢七周岁生日之际,Ubuntu正式推出了第四个LTS长期支持版本,开发代号Precise Pangolin的Ubuntu 12.04在2012年4月26日诞生。这是一个令很多linux爱好者振奋的日子,Ubuntu 12.04 LTS发布势必会掀起新的升级高潮,...
ubuntu12.04 服务器 入门指南,包含有关如何安装和配置各种服务器的信息。