Ubuntu set IP and DNS

Source: Internet
Author: User
Tags get ip

Note: If the Linux The system does not have Vim installed , use the delete and insert key to insert and delete, when moving up or down, to be in non-insert mode.

Command line mode:

set up dynamic get IP :

$vi/etc/network/interfaces

Auto Eth0

Iface eth0 inet DHCP

set static IP :

$vi/etc/network/interfaces

Auto Eth0

Iface eth0 inet Static

Address 192.168.161.xxx

Netmask 255.255.255.0

Gateway 192.168.161.1

Set up DNS:

$vi/etc/resolv.conf

NameServer 124.xxx.xxx.254

Note: In addition to 127.0.1.1 that, do not configure multiple DNS

The configuration takes effect and requires a restart of the network card (or restart the computer):

Ifconfig eth0 Down

Ifconfig eth0 up

Graphics Window Mode:

bottom right or upper right corner, click Network Settings, add IPv4 address, fill in IP and dns,ok! Take effect immediately!

Ubuntu set 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.