修改IP地址
1 編輯文件
nano /etc/network/interfaces
2 在選擇靜態IP或DHCP,編輯文件內容並保存退出
(1)靜態IP:
```
#Loop回環地址
auto lo
iface lo inet loopback
#將網卡eth0設置為靜態IP
auto eth0
iface eth0 inet static
#修改IP、子網掩碼、網關
address XX.XX.XX.XX
netmask XX.XX.XX.XX
gateway XX.XX.XX.XX
```
(2)DHCP自動獲取IP:
```
#Loop回環地址
auto lo
iface lo inet loopback
#將網卡eth0設置為DHCP自動獲取
auto eth0
iface eth0 inet dhcp
```
3 重啟網卡服務
```/etc/init.d/networking restart```
修改DNS
1 編輯文件
```nano /etc/resolv.conf```
2 添加DNS
```nameserver XX.XX.XX.XX```
from:http://blog.csdn.net/Stu_Li/article/details/52086851