Just to expand on this a little - you can use ping to test a lot of network related problems - say you cant get any connection at all - this could be a problem with your network card, your tcp/ip stack, your nettwork cable, your modem / router, your phone line, your ISP's network or, indeed the website that you are trying to connect, there are a lot of things that can go wrong =)
This is the method that I use to check someone's network when they tell me 'my internet isnt working' (I try not to tell them that the internet is not their internet, but it always falls on deaf ears...)
first,
ping 127.0.0.1
this is the ip address of your actual computer (its the IP address of everyones computer and cant be accessed from inside) if the ping returns ok then your TCP/IP stack works.
the next thing to do is to find out the ip address of your network card,
ipconfig (or ifconfig on linux)
this will tell you the ip address for your network card, ping that ipaddress.
if it returns ok, then your network card is working.
next ping your gateway (from the information in ipconfig)
if this works then the connection is good from your network card to your router.
next thing to do is to ping your nameservers (these are the machines that translate google.com into an ip address)
if they return good, then you have a proper working connection to the net.
test it out by typping
nslookup google.com
it should return ipaddresses that are for google.
the next step (if you cannot reach a website is to traceroute it (tracert on windows, traceroute on linux)
traceroute mywebsite.com
this will show you the ip addresses of each machine in the link from your machine to your web site.
hopefully you can tell the network administrator that their router is down and they need to go fix it =)
|