Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux centos : ping displays unknown host for any domain name

Tags:

linux

ping

centos

Ping displays unknown host for any domain name.

It worked before this time true!!

Ping works for ip address but fails for domain names.

Can any one help me?

like image 382
sj59 Avatar asked Aug 11 '14 05:08

sj59


People also ask

What does ping unknown host mean?

An unknown host message is generated when a user attempts to ping a host name without a configured DNS resolution. If the ping is unsuccessful, the user should verify that the ping was sent to the correct remote host address.

How do I find my DNS name Centos 7?

To test your setup, use the hostname command: Use hostname -s to get the short name (should reflect what you have in /etc/sysconfig/network. Use the hostname -d command to test your domain (should reflect what you have in /etc/resolv. conf )

Why Ping by IP does not work on CentOS?

This is not a CentOS issue. It is a DNS issue. You need to configure your DNS server to provide the proper IP address. Re: Ping by IP works but not via hostname! I don't have a specific DNS server. I am running this CentOS as a virtual machine within my Mac OS. Re: Ping by IP works but not via hostname! Then add the machine to the Mac's host file.

Why Ping by IP does not work with hostname?

It is a DNS issue. You need to configure your DNS server to provide the proper IP address. Re: Ping by IP works but not via hostname! I don't have a specific DNS server. I am running this CentOS as a virtual machine within my Mac OS.

Why Ping by IP doesn't work on my Mac?

You need to configure your DNS server to provide the proper IP address. Re: Ping by IP works but not via hostname! I don't have a specific DNS server. I am running this CentOS as a virtual machine within my Mac OS. Re: Ping by IP works but not via hostname! Then add the machine to the Mac's host file. It is still a DNS issue.

Is it legal to Ping An external domain?

Please don't try to ping any external domain like google.com. As far as I know it's illegel & not allowed and it's against IT ethics. For illustration purpose you could have changed original names with some dummy ones.


1 Answers

Check what's in /etc/resolv.conf. If there is no "nameserver" specified, you have to do that in order to resolve domains. Example:

nameserver dns1.domainname.com
nameserver dns2.domainname.com

or you can use Google's public DNS servers:

nameserver 8.8.8.8   
nameserver 8.8.4.4
like image 108
Zdravko Tatarski Avatar answered Oct 03 '22 16:10

Zdravko Tatarski