Internet problem

Why does my server ping prompt ping: Name or service notknown root domain name is the same. Whether the IP is blocked in China, but re turns normally after adding www. I changed servers many times and the problem still occurs. I tested both curl and dig. It should be a dns problem, but I added dns and it still didn’t solve the problem.

[root@centos-s-2vcpu-2gb-lon1-01 ~]# ping
ping: Name or service not known
[root@centos-s-2vcpu-2gb-lon1-01 ~]# ping
PING ( 56(84) bytes of data.
--- ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 10260ms

[root@centos-s-2vcpu-2gb-lon1-01 ~]# ping
ping: Name or service not known
[root@centos-s-2vcpu-2gb-lon1-01 ~]# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=50 time=51.2 ms
64 bytes from ( icmp_seq=2 ttl=51 time=32.9 ms
--- ping statistics ---
3 packets transmitted, 2 received, 33.3333% packet loss, time 2003ms
rtt min/avg/max/mdev = 32.913/42.078/51.244/9.167 ms
[root@centos-s-2vcpu-2gb-lon1-01 ~]# cat /etc/resolv.conf
; Created by cloud-init on instance boot automatically, do not edit.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
January 23, 2024


Based on the information you’ve provided, it seems like you are experiencing a DNS resolution issue. Here are a few points to consider:

  1. DNS Resolution for Root Domains vs. Subdomains: The fact that and resolve correctly while and do not could indicate that the root domains ( and don’t have DNS A records associated with them. This is not unusual; some domains are configured to only respond to requests for specific subdomains (like www).

  2. DNS Configuration: You have Google’s DNS servers ( and configured in your /etc/resolv.conf. These are generally reliable, but there could be specific regional or network-related issues affecting their ability to resolve certain domains. You might want to try using different DNS servers (like Cloudflare’s, or a local DNS server) to see if that changes the behavior.

  3. Network Restrictions: Given that the domains in question are Chinese (.cn), there might be network-level restrictions or routing issues affecting DNS resolution, especially if your server is located outside of China. The Great Firewall of China is known for its strict internet censorship, which can impact how certain domains are resolved or accessed from different locations.

  4. Ping vs. HTTP Requests: You mentioned using curl and dig. If curl works for accessing these sites via HTTP/HTTPS but ping does not, it could be because ICMP (the protocol used by ping) is blocked or filtered either by your network, the destination server, or somewhere in between.

  5. Testing with dig: To further diagnose DNS issues, you can use dig with different DNS servers to see how the resolution is handled. For example:

dig @
dig @

This can help determine if the issue is with the DNS servers or with the domain itself.

  1. Web Service Configuration: If you are trying to set up a web service on these domains, ensure that the DNS settings for your domain (at the domain registrar or DNS hosting service) are correctly set up to point to your server’s IP address.

In summary, it’s likely a DNS issue related to how the root domains are configured (not having A records) and potentially affected by regional network policies or restrictions. Using different DNS servers or querying specific subdomains (like www) that you know are configured correctly might help bypass these issues.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel