What should I do if centos cannot ping Baidu?

王林
Release: 2020-03-20 15:32:39
Original
12219 people have browsed it

What should I do if centos cannot ping Baidu?

Problem:

Unable to ping www.baidu.com in Linux.

There are two solutions, as follows:

Method 1: Open the /etc/resolv.conf configuration file

vi /etc/resolv.conf
Copy after login

Add the following content: (Recommended tutorial:centos usage tutorial)

nameserver 114.114.114.114 (电信的DNS)
nameserver 8.8.8.8(googel的DNS)
Copy after login

You can ping the external network.

Method 2: First execute the command ip a or ifconfig to check the network card used, and then enter /etc/sysconfig/network-scripts to find the corresponding network card and modify it.

vi /etc/sysconfig/network-scripts/ifcfg-ethx
Copy after login

What should I do if centos cannot ping Baidu?

Finally restart the network card.

service network restart
Copy after login

Recommended related video tutorials: linux video tutorial

The above is the detailed content of What should I do if centos cannot ping Baidu?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template