Ubuntu Server static IP and DNS server settings

Source: Internet
Author: User

Ubuntu's network parameters are saved in the file/etc/network/interfaces,

The default setting uses DHCP, which is obtained by dynamic IP. Here's how to set up a static IP: 1) Edit/etc/network/interfaces1.1) Add DHCP line shield # The primary network Interfaceauto eth0#iface eth0 inet DHCP 1.2) Add and static IP parameters # The primary network interfaceiface eth0 inet staticaddress 192.168.1,151netmask 255.255.255.0gateway 192.168.1.12) Edit/etc/resolv.conf, set DNS, and if you restart restore, you will also need to modify
/etc/resolvconf/resolv.conf.d/base file, two content like NameServer 192.168.1.1 #路由网关nameserver 8.8.8.8 #google的dns服务器 3) perform the following two commands , enable new settings $sudo Ifdown eth0$sudo ifup eth0

Ubuntu Server static IP and DNS server settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.