Am I online?

Introduction

A common issue that can blight a person's enjoyment of the Internet is a perceived loss of connection. Often, the connection is actually fine and the problem is with the upstream Domain Name Servers provided by your Internet Service Provider.

What is a DNS issue? In order to use facilities on the Internet, your computer must convert domain names (e.g. gaztronics.net) and 'A' records (e.g. www., mail., ftp.) to their associated public Internet Protocol (IP) address(es). This information request is usually sent over your in-house network to your router. The router in turn, sends it to the DNS servers provided by your Internet Service Provider (ISP). During normal operation, this chain of requests and responses is very quick (milli-seconds), but during peak-load times, the response can be very slow, or non-existent. Your router will wait a set period of time for the response [from the upstream DNS servers] before it times-out and responds with a failure to your computer. At this point, you may think your Internet connection has failed, when in fact, the upstream DNS servers have simply failed to respond. This tip aims to guide you through the diagnostic techniques a Systems Administrator would use to ascertain whether the Internet connection has failed, or if there is a DNS issue.

Different operating systems have different command-line commands, so we identify the differences with icons to match your system.

Windows Logo details commands for Microsoft windows.

Linux Logo
MacOS logo
details commands for Linux and MacOS. These are usually the same as both systems are based on Unix and share a common heritage.

Preparation

Before you can use the tips outlined below, you need to obtain a little bit of information about your Internet connection and keep that information to hand ready to use when you believe you have gone offline. We need to obtain the fixed-IP address of a device on the Internet that we can "ping" in order to test if the connection is still functioning. It is also advisable to use a wired connection to your Internet router to eliminate drop-out and interference one might find with a Wi-Fi connection. We also strongly recommend you avoid Power Line Technology for networking. See Ban PLT for more information on the problems it causes.

The easiest IP address to obtain is the default gateway of your router's public Internet connection. You should be able to find that information in the web-interface of your router. If you cannot find it, or it is hidden away, you can use the trace route technique outlined below.


Trace Route

Trace route is a useful network diagnostics tool which SysAdmins use to check the route IP traffic takes over a network. The lower the number of router "hops", the quicker the IP traffic will be at reaching you (or the other end). For our use, we want to find a router on the Internet Service Provider's (ISP) network that we can ping when attempting our diagnostics.

We need access to the command-line for this:

Windows Logo In Programs > Accessories, you will find the Command Prompt. Selecting the shortcut should produce a window with the C:\ prompt.

Linux Logo MacOS logo Start xterm.

We now need to trace route to something arbitrary. The target is un-important as we simply require the IP address of the next router in the chain. In this example, we are going to trace route to a webserver run by the BBC.

Windows Logo Enter the command tracert www.bbc.co.uk and press enter.

Linux Logo
MacOS logo
Enter the command traceroute www.bbc.co.uk and press enter.

You should obtain results as in the following example. This is from a Linux system via the Gaztronics network running out over the Eclipse Internet network, so your first few router hops will not have the same IP addresses.

traceroute to www.bbc.co.uk (212.58.244.71), 30 hops max, 60 byte packets
1 gateway.gaztronics.net (192.168.10.254) 0.602 ms 0.862 ms 1.115 ms
2 82.153.1.65 (82.153.1.65) 11.011 ms 11.226 ms 11.417 ms
3 91.85.10.53 (91.85.10.53) 11.950 ms 12.098 ms 12.346 ms
4 62.164.130.53 (62.164.130.53) 12.939 ms 13.080 ms 13.776 ms
5 vl-38.lon-th1cr.spn.kcom.com (86.54.183.249) 14.387 ms 14.539 ms 14.735 ms
6 mistral-bbc-gw0.prt0.rbsov.bbc.co.uk (217.154.155.238) 14.948 ms 14.711 ms 14.681 ms
7 * * *
8 * * *
9 ae0.er01.telhc.bbc.co.uk (132.185.254.109) 12.170 ms 12.550 ms 12.389 ms
10 132.185.255.148 (132.185.255.148) 15.596 ms 16.071 ms 16.200 ms
11 bbc-vip116.telhc.bbc.co.uk (212.58.244.71) 14.055 ms 14.842 ms 14.982 ms

Router hops 7 & 8 timed-out, so they are filled in with asterixes.

This next example is from a Windows system running the same trace route:

Tracing route to www.bbc.net.uk [212.58.246.91]
over a maximum of 30 hops:

  1     1 ms    <1 ms    <1 ms  gateway.gaztronics.net [192.168.10.254]
  2    10 ms     9 ms     9 ms  82.153.1.65
  3     9 ms     9 ms     9 ms  91.85.10.53
  4    10 ms    10 ms     9 ms  62.164.130.53
  5    10 ms    10 ms    10 ms  vl-38.lon-th1cr.spn.kcom.com [86.54.183.249]
  6    22 ms    10 ms     9 ms  mistral-bbc-gw0.prt0.rbsov.bbc.co.uk [217.154.155.238]
  7     *        *        *     Request timed out.
  8    11 ms    11 ms    11 ms  ae0.er01.cwwtf.bbc.co.uk [132.185.254.93]
  9    11 ms    11 ms    11 ms  132.185.255.165
 10    11 ms    11 ms    11 ms  bbc-vip012.cwwtf.bbc.co.uk [212.58.246.91]

Trace complete.

Router hops 7 timed-out, so it is filled in with asterixes.

The IP address we are interested in is the 2nd router hop 82.153.1.65. This is the default gateway of our Internet connection. Router hop 3 could also be used. Make a note of the IP address(es) of your default gateway (and 3rd router) for later use with the ping command.


Ping

Ping is one of the most useful tools used by SysAdmins to check if a remote host, or local network computer is on the network. Ping transmits ICMP echo-requests and listens for echo-replies - akin to a sonar system used at sea. If you receive echo-replies, you can safely assume the remote host or computer is on the network. If you do not, the remote host or computer is offline - or you are offline. Ping should be used with care. Remote hosts do not like being flooded with ping requests and many firewall systems will throttle the echo-replies, so you may see no responses after three pings.

To check if your Internet connection is alive, you can ping the default router, the IP address of which we found earlier.

Windows Logo Enter the command ping 82.153.1.65 (substituting this IP address for your local default gateway) and press enter. The Windows ping command will send four ICMP echo-requests only.

Linux Logo
MacOS logo
Enter the command ping -c 4 82.153.1.65 (substituting this IP address for your local default gateway) and press enter. The Unix ping command sends a continuous stream of ICMP echo-requests. The option -c 4 limits this to only four.

If your connection is working, you will see echo-replies as in the Linux example below.

PING 82.153.1.65 (82.153.1.65) 56(84) bytes of data.
64 bytes from 82.153.1.65: icmp_req=1 ttl=254 time=9.66 ms
64 bytes from 82.153.1.65: icmp_req=2 ttl=254 time=9.67 ms
64 bytes from 82.153.1.65: icmp_req=3 ttl=254 time=9.45 ms
64 bytes from 82.153.1.65: icmp_req=4 ttl=254 time=9.48 ms

And again from Windows.

Pinging 82.153.1.65 with 32 bytes of data:

Reply from 82.153.1.65: bytes=32 time=11ms TTL=254
Reply from 82.153.1.65: bytes=32 time=9ms TTL=254
Reply from 82.153.1.65: bytes=32 time=9ms TTL=254
Reply from 82.153.1.65: bytes=32 time=9ms TTL=254

Ping statistics for 82.153.1.65:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 9ms, Maximum = 11ms, Average = 9ms

If your connection is not working, you will see 100% packet loss, as in the Linux example below.

PING 82.153.1.65 (82.153.1.65) 56(84) bytes of data.

--- 82.153.1.65 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms

And again from Windows.

Pinging 82.153.1.65 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 82.153.1.65:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

If you can ping the default gateway of your Internet connection, it is a fair bet you are online and there may be a DNS issue (see below). If you cannot ping the default gateway, try the 3rd router hop IP address obtained in the trace route. If that times-out as well, your Internet connection is down. Try rebooting your router and run the ping tests after your router is back online (typically 2 to 3 minutes). If you have a cable, VDSL (FTTC), or Ethernet-over-Fibre (FTTP) service, you may need to reboot those devices as well.


DNS issues

You can ping the default gateway of your Internet connection, but any attempts to browse the web, or send email are failing. This is likely to be a DNS issue and here are some tips to help you.

From the same command-line prompts as detailed above, you can try the following commands:

Windows Logo Enter the command nslookup www.bbc.co.uk (or use a web address you do not commonly visit, such as www.nasa.gov) and press enter.

Linux Logo
MacOS logo
Enter the command dig www.bbc.co.uk (or use a web address you do not commonly visit, such as www.nasa.gov) and press enter.

If the upstream DNS server is working and responding within the time-out period, you should see something like this:

Server: liberator.gaztronics.net
Address: 192.168.10.253

Non-authoritative answer:
Name: www.bbc.net.uk
Address: 212.58.244.68
Aliases: www.bbc.co.uk

And on Linux/MacOS:

; <<>> DiG 9.7.4-P1-RedHat-9.7.4-2.P1.fc14 <<>> www.bbc.co.uk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55428
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 3, ADDITIONAL: 0

;; QUESTION SECTION:
;www.bbc.co.uk. IN A

;; ANSWER SECTION:
www.bbc.co.uk. 300 IN CNAME www.bbc.net.uk.
www.bbc.net.uk. 300 IN A 212.58.244.68

;; AUTHORITY SECTION:
bbc.net.uk. 162252 IN NS ns0.rbsov.bbc.co.uk.
bbc.net.uk. 162252 IN NS ns0.thdow.bbc.co.uk.
bbc.net.uk. 162252 IN NS ns0.tcams.bbc.co.uk.

;; Query time: 35 msec
;; SERVER: 192.168.10.253#53(192.168.10.253)
;; WHEN: Thu Sep 20 15:18:46 2012
;; MSG SIZE rcvd: 145

If the upstream DNS server fails to respond, you may see something like this:

*** Can't find server name for address 192.168.10.253: No response from server
*** Default servers are not available
Server: UnKnown
Address: 192.168.10.253

*** UnKnown can't find www.bbc.co.uk: No response from server

And on Linux/MacOS:

; <<>> DiG 9.7.4-P1-RedHat-9.7.4-2.P1.fc14 <<>> www.bbc.co.uk
;; global options: +cmd
;; connection timed out; no servers could be reached

Consistent time-outs mean the upstream DNS servers are overloaded (from under-provisioning/viruses/malware/DDoS attack) or offline. If you suffer repeated DNS failures, check your router is running the latest firmware, then contact your Internet Service Provider for help. If you cannot resolve the issue, or you want to avoid your ISP's DNS servers, you can use other DNS services, such as those offered by OpenDNS. Changes to the DNS servers used will need to be made inside your router and they will affect all of the computers/mobile devices on your in-house network.


Page updated: 17th February 2014