Linux modified IP address, network management, hostname, DNS

Source: Internet
Author: User

[[Email protected]~]# Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device=eth0 # NIC name

Bootproto=static # Static IP Address Acquisition Status such as: DHCP indicates auto get IP Address

ipaddr=192.168.186.128 #IP Address

netmask=255.255.255.0 # Subnet Mask

Onboot=yes # whether to activate at boot time

gateway=192.168.1.1

Modify Linux System of Host name :

[[Email protected]~]# vi/etc/sysconfig/network

Hostname=cuilong # Modify host name, restart effective

gateway=192.168.1.1 # Modify the default gateway , if the above eth0 If the gateway is not configured, the gateway is used by default.

Modify Linux of the DNS

[[Email protected]~]# vi/etc/resolv.conf # Modify DNS Information

NameServer 192.168.1.1

after the configuration is complete, restart the network card with 3 Medium Method:

1 , #ifup eth0

2 , #service Network Restart

3 , #/etc/init.d/network Restart


This article from "Clay Turtle" blog, declined reprint!

Linux modified IP address, network management, hostname, 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.