Home >Operation and Maintenance >CentOS >What should I do if I can ping the domain name successfully under CentOS but cannot ping it?

What should I do if I can ping the domain name successfully under CentOS but cannot ping it?

王林
王林Original
2020-03-26 15:37:343839browse

What should I do if I can ping the domain name successfully under CentOS but cannot ping it?

Problem:

ping: www.baidu.com: Name or service not known

Analysis:

There is a problem with domain name resolution.

(Recommended tutorial: centos tutorial)

Solution:

1. Open the /etc/resolv.conf file

2. Add nameserver, as follows:

> nameserver 192.168.37.2

The IP following is the DNS address configured in ifcfg-ens33 before.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of What should I do if I can ping the domain name successfully under CentOS but cannot ping it?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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