Centos DNS modification, fixed IP, and other operations

Source: Internet
Author: User
Tags nameserver

1. Modify DNS

Modify the DNS configuration file of the corresponding Nic

 
VI/Etc/resolv. conf

Content format (xigong University)

; Generated by/sbin/dhclient-Scriptnameserver114.114.114.114Nameserver202.117.80.2Nameserver202.117.80.3Nameserver202.117.80.200

2. Modify the Gateway 

 
VI/Etc/sysconfig/Network

Modify the following content

Networking =Yes (indicates whether the system uses the network, which is generally set to yes. If it is set to no, the network cannot be used, and many system service programs cannot be started.) hostname= Centos (set the Host Name of the local machine. The host name and/etc/The host name set in hosts corresponds to) Gateway=192.168.1.1(Set the IP address of the gateway connected to the local machine. For example, the gateway is 10.13.32.1)

3. Specify the IP address

 
VI/Etc/sysconfig/network-scripts/ifcfg-eth0

Make sure the specified IP address does not conflict.

Device = eth0 # describe the device alias corresponding to the NIC, for example, ifcfg- In the eth0 file, it is eth0bootproto = Static # Set the way for the NIC to obtain the IP address. The possible options are static, DHCP or BOOTP, which correspond to the IP address specified at the static state, the IP address obtained through the DHCP protocol, and the IP address obtained through the BOOTP protocol.  Hwaddr = 00 : 07 : E9: 05  : E8: B4 # physical IP address of the corresponding network adapter ipaddr = 10.13 . 32.123  # If you set the method for obtaining the IP address from the NIC to static, this field specifies the IP address of the NIC.Gateway = 10.13.32.1 # Gateway

Netmask =255.255.255.0# Network mask corresponding to the NIC

Prefix = 24

Defroute = Yes

Ipv6init = No1_6_autoconf = No Onboot = Yes
Type = Ethernet

Nm_controlled = Yes

 

Centos DNS modification, fixed IP, and other operations

Related Article

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.