Ubuntu 16 Set fixed IP and DNS

Source: Internet
Author: User
Tags nameserver

Ubuntu 16 set Fixed IP address and DNS

1. Set the IP address

Vi/etc/network/interfaces

Add the following content:

# The Primary network interface

# ens160 is a network card, do not know what kind of network card, you can use the command IP addr View
Auto ens160
Iface ens160 inet Static

# set a fixed IP address, example below
Address 10.0.0.2

# subnets and gateways can be viewed through route-n
Netmask 255.255.255.0
Gateway 10.0.0.1

2. Set up DNS

Vi/etc/resolvconf/resolv.conf.d/base
NameServer 10.0.0.200
NameServer 10.0.0.201

3. Refresh the configuration file

Resolvconf-u

4. Restart the Network Service

/etc/init.d/networking restart

5. Then restart the shutdown:

Using the IP addr command, you can see that the IP address is fixed.


This article is from the "brave" blog, make sure to keep this source http://brave8898.blog.51cto.com/289041/1965352

Ubuntu 16 Set fixed IP and DNS

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.