Centos manual IP and DNS configuration, centosipdns

Source: Internet
Author: User

Centos manual IP and DNS configuration, centosipdns

Set IP addresses manually

If the virtual machine cannot automatically obtain the IP address, you can only manually configure it as follows:

Enter the command

# Vi/etc/sysconfig/network-scripts/ifcfg-eth0 [edit Nic configuration file]

Enter the preceding command and press enter to open the configuration file. Use the arrow key to move the cursor to the last line. Press "O" to enter the editing mode. Enter the following content:

IPADDR = 192.168.4.10

NETMASK = 255.255.255.0

GATEWAY = 192.168.4.1

In addition, move the cursor to the line "ONBOOT = no" and change it to ONBOOT = yes.

"BOOTPROTO = dhcp", changed to BOOTPROTO = none

After that, press the ESC key in the upper left corner of the keyboard. Enter wq in the lower left corner of the screen and press enter to save the configuration file.

 

Restart the network service. The command is

# Servicenetwork restart

After the network is restarted, the ip address of eth0 takes effect. Run the command # ifconfigeth0 to view

Next, check whether the configured IP address can be pinged. On the physical machine, use the shortcut key WINDOWS + R to open the run box, enter the command cmd, and enter ping 192.168.4.10. ping indicates that the IP address is correctly configured.

 

Note: The network segment of my physical machine is 192.168.4.0. During the experiment, you can set up your own environment to keep the virtual machine and the physical machine in the same network segment.

 

1. modify the configuration file vi/etc/resolv. conf.

Ii. Modify by format

nameserver 8.8.4.4nameserver 8.8.8.8

Modify the Domain Name System IP address of Google in the preceding format. Save the modification and the modification takes effect.

In Guangdong, this is 202.96.128.86.

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.