配置Ubuntu 静态IP

Ubuntu的网络配置信息是保存在 /etc/network/interfaces 文件中,使用Vim打开配置文件,默认是自动获取IP的配置.以下:
# The primary network interface
auto lo
auto eth0
iface eth0 inet dhcp

咱们如今须要把dhcp 改成static,而后接着在下面设置IP地址,设置后该配置文件内容以下,
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.102
netmask 255.255.255.0
gateway 192.168.0.1
网络


配置DNS Server

修改/etc/resolv.conf
dom

sudo vi /etc/resolv.conf
在里面输入, 
search domainname.com
nameserver 192.168.0.104
注:以上修改会在机器重启后被覆盖,  若是重启机器后这次修改继续生效的话,须要在文件   /etc/resolvconf/resolv.conf.d/base里输入以上内容,
相关文章
相关标签/搜索