Ubuntu ip&dns配置


Ubuntu ip&dns配置
 
1.设置IP, 
终端输入 sudo gedit /etc/network/interfaces 
假设实用的是网卡0,如果是其它网卡就将eth0改为对应的值。 
auto lo   www.2cto.com  
iface lo inet loopback 
#使用网卡0 
auto eth0 
#使用静态IP 
iface eth0 inet static 
#设置IP 
address 172.32.1.11 
#设置子网掩码 
netmask 255.255.0.0 
#设置网关 
gateway 172.32.1.215 
  www.2cto.com  
2.配置DNS 
如果需要手动配置DNS 
终端输入sudo  vi /etc/resolv.conf 
在其中加入以下代码(211.153.31.2换为你的DNS) 
nameserver 211.153.31.2 
 
3.重启网络 
sudo /etc/init.d/networking restart

相关内容

    暂无相关文章