歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Ubuntu ip&dns配置

Ubuntu ip&dns配置

日期:2017/3/1 17:02:32   编辑:關於Linux
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
Copyright © Linux教程網 All Rights Reserved