![]() |
I'm getting "Unknown host name" when i try to ping <hostname>
It would be more clear if i put up things through command outputs..
>ping www.google.com ping: unknown host www.google.com >ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=0 ttl=128 time=40.6 ms 64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=36.9 ms > nslookup www.google.com Server: 192.168.232.2 Address: 192.168.232.2#53 Non-authoritative answer: Name: www.google.com Address: 173.194.38.147 Name: www.google.com Address: 173.194.38.148 Name: www.google.com Address: 173.194.38.144 Name: www.google.com Address: 173.194.38.145 Name: www.google.com Address: 173.194.38.146 >host www.google.com www.google.com has address 173.194.38.147 www.google.com has address 173.194.38.148 www.google.com has address 173.194.38.144 www.google.com has address 173.194.38.145 www.google.com has address 173.194.38.146 Some one please explain me what has to be done to rectify this issue. |
You need to put two DNS server addresses in /etc/resolv.conf. I looks like you're using Google's freely available DNS servers, so, open a terminal, and to this:
Code:
su - <or sudo> You could also use a text editor; e.g., vi, vim. Hope this helps some. [edit] Forgot to mention: read the manual page for resolv.conf for a complete explanation Code:
man resolv.conf |
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.
Anyway, here in your case, your system isn't able to resolve hostnames against IP adresses. Use following commands to check hostnaems, and then make appropriate entries of hostname against IP in /etc/resolv.conf file (as shown in above response). # nslookup 8.8.8.8 OR, # dig -x 8.8.8.8 |
Quote:
|
I think the idea of isolated pings is getting confused with DDoS. http://staff.washington.edu/dittrich/misc/ddos/
|
ping -c5 google.com or www.google.com
""-c count - Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires."" -c5 pings = five times. -c10 pings = ten times. You can always control the amount of pings. Pings are not illegal. |
You should check your nsswitch.conf
Hello shany!
You might want to check your nsswitch.conf to see if dns is used for name resolution. If not, this would explain why nslookup is working properly (implements dns itself) and ping is not (uses system name resolution). For more information check Code:
man 5 nsswitch.conf |
Quote:
Thanks for your reply.After re-correcting one entity pertaining to the dns lookup in the nsswitch.conf now everything is going good. Thanks for all your replies.. |
All times are GMT -5. The time now is 09:20 PM. |