Configuration of IP, DNS, hostname under Ubuntu

Source: Internet
Author: User

One, configure IP

Ubuntu's network configuration information is placed in the/etc/network/interfaces,

If the configuration dynamically obtains the IP, add the following to the above file:

Auto Eth0

Iface eth0 inet DHCP

If you configure a static IP, add the following:

Auto Eth0

Iface eth0 inet Static

Address 192.168.33.201

Netmask 255.255.255.0

Gateway 192.168.33.1

If the configuration is active, you need to restart the NIC:

Ifconfig eth0 Down

Ifconfig eth0 up

Not root, add sudo to the front of the command

If there is no successful configuration, you need to restart the network service

/etc/init.d/networking Restart or service networking restart

Second, configure the DNS server

Ubuntu DNS server information, placed in the/etc/resolv.conf,

Add a DNS server address, such as 202.112.125.53, in the file above

NameServer 202.112.125.53

Third, permanently modify the host name

It is also easier to permanently modify the hostname in the Ubuntu system. Host name in the/etc/hostname file, modify the host name, edit the hostname file, enter a new hostname in the file and save the file

/etc/hostname


Summary:

As long as the above steps are configured, you will be able to surf the internet, if not yet restart the machine to try.


This article is from the "Chen blog" blog, make sure to keep this source http://chenshengang.blog.51cto.com/4399161/1600573

Configuration of IP, DNS, hostname under Ubuntu

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.