您的位置:首页 > 理论基础 > 计算机网络

Ubuntu Server修改IP/DNS

2013-05-13 14:09 489 查看
在向大家详细介绍Server之前,首先让大家了解下Ubuntu Server,然后全面介绍Ubuntu Server,希望对大家有用。Ubuntu 团队对它的使用者公开的承诺:Ubuntu 永远免费 , 并且对于 "企业版本" 没有任何额外的费用, 在同样的自由团队上,将最好的工作成果带给每一个人。 实验室内部搭建了个网站,放在虚拟机中Ubuntu Server下,需要进行配置以便局域网内都可以访问。

虚拟机改成"桥接"模式.

(1)Ubuntu Server修改IP

打开 /etc/network/interfaces
sudo vim /etc/network/interfaces

加入以下语句:
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx #IP地址
netmask xxx.xxx.xxx.xxx #子网掩码
gateway xxx.xxx.xxx.xxx #网关

(2)Ubuntu Server修改DNS

修改网卡 DNS 地址的方法
sudo vim /etc/resolv.conf改为如下内容:
search localdomain
nameserver 172.16.3.4 希望修改成的DNS
nameserver 172.16.3.3 希望修改成的DNS


(3)Ubuntu Server最后一步,也是最重要的一步。

在rc.local里加入这个重启网络配置的命令:
sudo /etc/init.d/networking restart

原文地址:http://os.51cto.com/art/201001/175343.htm
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息