jarod8016b 发表于 2018-5-7 12:52:06

Ubuntu下修改IP地址 DNS

  sudo vi /etc/network/interfaces
  # This file describes the network interfaces available on your system
  # and how to activate them. For more information, see interfaces(5).
  # The loopback network interface
  auto lo
  iface lo inet loopback
  # 动态IP
  # 内容如下:
  # The primary network interface
  auto eth0
  iface eth0 inet dhcp
  # 静态IP地址:
  # 内容如下:
  # The primary network interface
  auto eth0
  iface eth0 inet static
  address 172.19.0.10
  netmask 255.255.255.0
  #network 172.19.0.0
  #broadcast 172.19.0.255
  gateway 172.19.0.1
  然后重启网络服务,使IP地址生效
  sudo /etc/init.d/networking restart
  再来添加DNS解析服务器
  sudo vi /etc/resolv.conf
  内容如下:
  search domain.com
  nameserver xxx.xxx.xxx.xxx
  如:
  nameserver 218.85.157.99
  nameserver 218.85.152.99
  完毕!
页: [1]
查看完整版本: Ubuntu下修改IP地址 DNS