Diagnosing Internet Connectivity Problems
Here are some tests you can use to check the basic functionality of your internet connection.
On an Apple (Mac) system all of these tests are done in a "Terminal" window. Launch the application "Terminal" (which is usually in a folder called "Utilities" within the main Applications folder).
On a Linux system this is sometimes called an "xterm" or "console" window.
On Windows XP, Vista or Windows 7 systems you need a "DOS prompt" window, which can be accessed by selecting "Run..." from the Start menu and typing "command" when asked what command to run. All steps except step 2 should work as shown here. Note that in some cases the Windows version of the command is a little different. Step 2 uses a command that does not have a direct Windows equivalent, so just skip that step.
1. ifconfig or ipconfig
On a Mac or Linux system, type ifconfig and look for a line that looks like one of these:
inet 192.168.1.45 netmask 0xffffff00 broadcast 192.168.1.255 inet 25.37.172.163 netmask 0xfffff000 broadcast 25.37.191.255either of which means you're connected to a router of some kind (possibly via a cable or DSL modem). If the only "inet" line has the numbers 127.0.0.1 like this:
inet 127.0.0.1 netmask 0xff000000then your computer doesn't think it is connected to anything (ether wired or wireless).
On a Windows system the command to type is ipconfig and you want to see a line like one of these:
IP Address. . . . . . . . . . . : 192.168.1.45 IP Address. . . . . . . . . . . : 25.37.172.163If you see no lines like this or if all of the "adapter" sections have a line like:
Media State . . . . . . . . . . : Media disconnectedthen your computer doesn't think it is connected to anything.
2. Local routing tables
(Windows users should skip this step)
Type route -n get 192.168.1.123 where the numbers are the same as in the inet line from step 1, but with the last number changed (here I changed 192.168.1.45 to 192.168.1.123). It should display something like:
route to: 192.168.1.108 destination: 192.168.1.0 mask: 255.255.255.0 interface: en1this means it knows it is sending packets to a network 192.168.1.0 connected to interface en1.
Now try route -n get 8.8.8.8
"8.8.8.8" is an address on the Internet (the Google DNS primary server). This command should give an answer like:
route to: 8.8.8.8 destination: default mask: default gateway: 192.168.1.1 interface: en1Note here it says gateway and there are no numbers next to destination. This means it knows it has to go through the router at 192.168.1.1 in order to reach address 8.8.8.8. This is the desired result. (If you only have a cable/DSL modem, and do not have any "router", "base station" or "hub", then you might find that the first example give an answer similar to this example. That is okay.)
3. ping to a remote address, and traceroute
Now we can try sending a message to another computer (which steps 1 and 2 do not). Type ping -c 5 8.8.8.8
This should display something like:
PING 8.8.8.8 (8.8.8.8): 56 data bytes 64 bytes from 8.8.8.8: icmp_seq=0 ttl=52 time=25.226 ms 64 bytes from 8.8.8.8: icmp_seq=1 ttl=52 time=28.386 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=52 time=26.344 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=52 time=22.819 ms 64 bytes from 8.8.8.8: icmp_seq=4 ttl=52 time=27.784 ms --- 8.8.8.8 ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max/stddev = 22.819/26.112/28.386/1.982 msIf instead you see either of the following lines:
ping: sendto: No route to host 5 packets transmitted, 0 packets received, 100% packet lossthen your packets aren't getting anywhere. This is the most common problem when for example your wireless router is disconnected from the rest of the internet, if the cable modem isn't connected, etc.
If packets don't reach an address like 8.8.8.8, type /usr/sbin/traceroute 8.8.8.8 (or, on a Windows system, type tracert 8.8.8.8 ). The result should be something like this:
traceroute to 8.8.8.8 (8.8.8.8), 64 hops max, 40 byte packets 1 192.168.1.1 (192.168.1.1) 1.162 ms 1.040 ms 1.223 ms 2 192.168.0.1 (192.168.0.1) 1.952 ms 1.680 ms 1.790 ms 3 73.175.107.1 (73.175.107.1) 9.419 ms 18.471 ms 10.046 ms 4 ge-1-5-ur04.cambridge.ma.boston.comcast.net (68.84.185.42) 14.090 ms 10.201 ms 26.761 ms 5 be-51-ar02.needham.ma.boston.comcast.net (68.85.162.15) 10.331 ms 8.640 ms 14.339 ms 6 pos-2-5-0-0-cr01.newyork.ny.ibone.comcast.net (68.86.90.65) 17.063 ms 21.017 ms 17.596 ms 7 pos-0-4-0-0-pe01.111eighthave.ny.ibone.comcast.net (68.86.86.194) 18.115 ms 17.762 ms 18.445 ms 8 as15169-3.111eighthave.ny.ibone.comcast.net (75.149.230.194) 38.823 ms 40.981 ms 46.889 ms 9 72.14.238.232 (72.14.238.232) 16.551 ms 209.85.255.68 (209.85.255.68) 152.161 ms 26.206 ms 10 72.14.239.93 (72.14.239.93) 24.167 ms 209.85.249.11 (209.85.249.11) 24.224 ms 27.238 ms 11 64.233.175.219 (64.233.175.219) 23.184 ms 64.233.175.111 (64.233.175.111) 22.994 ms 64.233.175.109 (64.233.175.109) 28.345 ms 12 72.14.232.21 (72.14.232.21) 28.212 ms 216.239.49.145 (216.239.49.145) 31.619 ms 72.14.232.21 (72.14.232.21) 32.787 ms 13 google-public-dns-a.google.com (8.8.8.8) 22.874 ms 23.368 ms 22.955 msif you only get a couple lines of text, like this:
traceroute to 8.8.8.8 (8.8.8.8), 64 hops max, 40 byte packets 1 192.168.1.1 (192.168.1.1) 2.796 ms 1.515 ms 2.315 ms 2 192.168.0.1 (192.168.0.1) 1.620 ms 10.344 ms 27.752 ms 3 * * * 4 * * * 5 * * * 6 * * * 7 * * *then the problem is in your local network or your connection to the cable/DSL/etc. internet provider.
4. DNS lookup
Once you have verified that you can ping to 8.8.8.8, you have access to Google's Domain Name Service, and you can then use it to look up any website.
Type the command: nslookup google.com. 8.8.8.8 making sure to include the "." after "google.com". This command should print:
Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: google.com Address: 173.194.33.104Under Windows, the command is the same, but the output should look more like this:
Server: google-public-dns-a.google.com Address: 8.8.8.8 Non-authoritative answer: Name: google.com Address: 173.194.33.104This does not actually talk to google.com, it just looks up its numeric address (which is shown here in the answer section, it is 173.194.33.104). This is another address you can try with ping (as described in step 3).
You can continue to try different sites with nslookup and ping to determine if you have access to all of the internet or only certain parts.
5. Normal hostname lookup
Now try the command nslookup google.com. (and again make sure to include the "." at the end). This is the same test as in step 4 but leaving off the "8.8.8.8". It should show the same "answer" section. Here is a Mac/Linux example:
Server: 25.37.179.193 Address: 25.37.179.193#53 Non-authoritative answer: Name: google.com Address: 173.194.33.104The important difference is that this time you are using the domain name server that your computer is set to use by default, rather than the Google DNS server at 8.8.8.8. (In this example, the ISP is a cable company and it has a DNS server at 25.37.179.193). If this test works, your browser should be able to locate website hosts.
If you get this far then ping should work with a hostname instead of numbers, such as ping google.com so you can try that with different hostnames around the internet.
If the nslookup test shows an error, like one of these:
** server can't find google.com.: NXDOMAIN ;; connection timed out; no servers could be reachedthis indicates your computer is unable to convert host names into numeric addresses. In this case, most attempts at web browsing will fail.
6. Try a browser
Once all of the above works, basic web browsing should work; if not you should try a different browser (Chrome, Firefox, Internet Explorer, Opera, Safari, etc...). Also check your browser settings, and look for instructions related to the specific browser.
Here are some troubleshooting sites for specific browsers. Much more can be found just by typing a description of the symptom (for example "browser video is blank" into a Google or Bing search.
Chrome (Google):
eHow: Problems With Google Chrome Browser
Chrome Plugins Trobleshooting (forum — use the search box near the upper-right)
Firefox (Mozilla):
mozilla: Basic Troubleshooting
Internet Explorer (Microsoft):
ComputerHope: Basic MSIE troubleshooting
Microsoft Support (use the "Search Microsoft Support" box in the upper-right)
Opera:
Opera Browser Wiki: Troubleshooting
SmartComputing: Troubleshooting Opera
Safari:
Multiple Browsers:
Trouble Fixers: Troubleshooting Tips
Sources
I tested the examples on Mac OS X, Windows XP and Windows 7 systems. More details about the commands can be found online:
Apple Mac OS X manual pages (examples: dig, route, traceroute)
Microsoft TechNet (examples: nslookup, ping, tracert)
Wikipedia (examples: ipconfig, ping, traceroute)
On a Mac or Linux system, you can often learn more about a command from the built-in documentation ("manual") using the man command. For example, type man ping for information about ping.
This page was written in the "embarrassingly readable" markup language RHTF, and was last updated on 2010 Jul 26.
