Linux Ubuntu static IP & permanent DNS 静态IP和永久DNS设置

1. Static IP

vi /etc/network/interfaces

Modify, or add below lines (x.x.x.x is the IP you have to know)

auto eth0
iface eth0 inet static
address x.x.x.x
netmask 255.255.255.0
gateway x.x.x.x

if you use DHCP, only add below line:

auto eth0
iface eth0 inet dhcp

=================================

2. Permanent DNS

vi /etc/resolvconf/resolv.conf.d/base

write your DNS IP

Restart network service or reboot machine.

 

posted @ 2016-10-29 10:05  palmydog  阅读(835)  评论(0编辑  收藏  举报