Is there any common always up server, which I can setup to ping in automatic mode to detect internet is available? Like Google or something? May be

My specific situation is that I am using dual WAN router. Each WAN is connected to one of ISPs. When my money is ending on one of ISP, it is not blocking the channel. Instead, it redirects to a warning page. So, router thinks internet is on, because data is traveling. Other option for this router is to ping for some address to check if internet is on.

I wonder, if I ping, won't I be banned by Google for inappropriate usage? I suspect, that Google might have some quotas. If I will ping it's name servers too often, then I will sometimes get DNS rejects .

  • 1
    I would suggest you test for what you actually want. When you say "Internet is available", what do you mean? Jun 15, 2014 at 9:24
  • 1
    @DavidSchwartz he means that the internet is not unavailable. If you want a specific test, much is going to be WAN based so not an option to test 'cos it's past the wall but the ISP would know.
    – barlop
    Jun 15, 2014 at 12:07
  • 5
    ping stackexchange.com ;)
    – user256743
    Jun 15, 2014 at 13:16
  • 6
    @barlop That's kind of funny, but not helpful. What does "the internet is not unavailable" mean? If I can't reach Google's website, is "the internet unavailable"? If DNS works but no web pages work, is the internet available? The first step to answering a question is understanding the question. Jun 15, 2014 at 15:00
  • 4
    @DavidSchwartz I was't joking,and considering that he's talking about pinging a google related IP as a test,and not pinging a domain like www.google.com as a test,he obviously means that in a case where DNS is unavailable but everything else is available,then he considers the Internet is available.i.e.not unavailable.If u want to find a question mark,it'd b whether a poor router is 'internet unavailable' but obviously if u could provide a test 4 that scenario vs WAN available,or specifics within that,it'd be more helpful than just giving him a test for just one specific case or worse,no cases.
    – barlop
    Jun 15, 2014 at 20:05

7 Answers 7


Try to ping, it's Google primary DNS server. I always ping it to verify my connection and I never found it down. Alternatively you can try, which is Google secondary DNS.

  • 3
    ping accepts TLDs as well. Hence ping google.com should do the trick, in case you don't want to remember quadruple eight. Jun 15, 2014 at 15:40
  • 38
    @JohannesPille Pinging a domain name requires a working DNS server. It could thus fail if the DNS request failed, which does not imply that your internet connection is actually down.
    – Jonathan
    Jun 15, 2014 at 15:53
  • 3
    If your authoritative name server would be down, the net in your zone wouldn't be of much use, would it? Jun 15, 2014 at 16:50
  • 6
    @JohannesPille you could override your primary DNS to instead of the DCHP default Jun 15, 2014 at 17:37
  • 6
    @JohannesPille ping doesn't accept TLDs. It also doesn't accept domain names. It is just so that most domain names are also host names and resolve to an IP address. So people could type http://example.com instead of http://www.example.com, before browsers were so smart to prepend www. to a hostname if it didn't work in the first place. (Try to ping army.mil if you don't believe me.)
    – Dubu
    Jun 15, 2014 at 21:50

You can do what microsoft does: check that


returns "Microsoft NCSI". (This verifies that you can get the correct data from a site, e.g. not a Wifi portal or something else).

You can also check (e.g. ping) that dns.msftncsi.com

points to (this verifies that DNS is working).

See http://technet.microsoft.com/en-us/library/ee126135

NB: You can also visit http://www.msftconnecttest.com/redirect to get yourself through a captive portal if needed.

  • 1
    +1. IIRC, Windows also has an API for checking the level of internet connectivity using this method.
    – Navin
    Jun 17, 2014 at 10:59
  • 7
    Why isn't this more upvoted? one of the few really good ways, especially for the specific Question. If your ISP redirects your traffic to a warning page, checking the answer like this is one of the few reliable options!
    – Falco
    Jun 17, 2014 at 15:35
  • 1
    No longer works Jun 9, 2017 at 9:18
  • 1
    What doesn't work? The site still returns the right text, the dns still resolves to the right IP, the documentation still returns the right info
    – Mark Sowul
    Jun 9, 2017 at 18:19
  • 1
    @Jon-Eric, I appreciate the added detail you contribute, but it very much removes (what I attempted, anyway, to be) its "simple / user-friendly" focus that contains primarily what's relevant to most people. If you'd like to add technical details, consider adding them at the bottom, but try not to dilute it. (For example I understand what you're going for with the "Microsoft NSCI" header, but for a user-focused answer, starting with that is merely clutter). Similarly, checking ipv6 specifically is niche, so while worthy of a footnote, I don't think it belongs in the main body.
    – Mark Sowul
    Jun 11, 2020 at 14:39

Specific case

You want to ping the "nearest" fixed IP that is non-routable when the ISP enters traffic overload state. On my system I can emulate this situation by failing the ADSL authentication. In that case, by comparing the results of traceroute -n in normal and abnormal conditions, I see that the first hop to (or any surely external site) that does not respond is, which is part of my ISP's infrastructure.

By using that IP as a "check-alive" host (after repeating the test just to be sure it is fixed), I can detect an ISP anomaly without getting a false positive in case the ADSL is OK, but the ISP routing has troubles.

Of course, I could use on purpose, reasoning that if I can't reach Google's infrastructure, I don't care about the reason, I might as well try with the backup router.

General case

"internet is available" is a much more complicated thing than simply "Is (or other IP) reachable".

For a quick, dirty and not always reliable check, pinging is good. But seeing as how you use a numeric IP instead of a domain name, you've already cottoned up to the fact that you might have IP connectivity and still "no Internet" because of DNS problems.

A complete diagnostic would have to start close to your PC.

  • query local network configuration and retrieve gateway and DNS server.
  • ping the gateway. It should be reachable. If not, there's a local problem.
  • run a traceroute with short TTL (actually, a TCP traceroute such as the one provided by hping is better) of a surely external address, is okay.
  • you want to see that, after your gateway, some extra nodes are responding.

For example in Windows XP at home I have:

 1    <1 ms    <1 ms    <1 ms   -- (constant) Home Linux box (gateway)
 2    <1 ms    <1 ms    <1 ms     -- (constant) ADSL modem
 3     *        *        *     *               -- WAN interface, always fails; expected
 4     *        6 ms     6 ms     -- (varies) ISP gateway

Now try pinging DNS. It should be reachable. Even better, run a simple DNS check. In order to avoid DNS caches, I sometimes use some domain which will answer to all queries no matter what. So for example

$ host randomasdfdsasdqwerty987667.godaddy.com
randomasdfdsasdqwerty987667.godaddy.com has address

while if the DNS server is unreliable, the same query might return the address of the captive portal for wifi

$ host randomasdfdsasdqwerty987667.godaddy.com
captiveportal.homenet has address

or, or even an error.

In case of DNS failures I may try a traceroute of the DNS IP address (or a different DNS such as OpenDNS's ones). That will not only tell me whether the problem is the DNS or the ISP, it will often allow me to work around the interruption.

If everything goes OK at this point I know that the connection is in working order, in general; it may still fail for some sites. All I need now is for isup.me to be up :-), then checking


or a site such as Down Detector will keep me informed about the "Internet weather".

Actually, on my home server there's a Squid cache and the error page contains the last data retrieved successfully from down-site statistics, so I may see something like

                Google.com is not reachable

                STORM ALERT: 12 out of 14 sites are unreachable!

just as it happened this last Friday here in Italy.

  • If you can ping, just switch your DNS server to that so ISP DNS problems don't matter Jun 15, 2014 at 19:16
  • 2
    Yes, but you should do that only after you have verified that the problems are, indeed, DNS based. Other kind of problems exist, and they might well leave routing to (or the ICMP protocol) intact while wrecking something else. Conversely, failure to ping might not indicate a routing or DNS problem at all.
    – LSerni
    Jun 15, 2014 at 20:10

As a couple have said, you can ping, say, the Google primary DNS to obtain a response but do not rely on one address. The address (for a number of reasons) may be down for a period of time, during which your software will report "no connectivity", when, in fact, your network connectivity may not be experiencing any problems. You should always attempt to communicate with more than one address so you can rule out false negatives.

I would write a function that pings an address once, if that fails move on to another (up to, say, three IPs) and the moment you get a couple of positive replies the function should notify your application/script that Internet is available and continue.


I've been using for more than over 10 years.. Before there was Googles' public DNS service. It seems to be a reliable DNS cache and ICMP responder.


When I worked for an organization with a flakey internet connection, I had a script which tested several "always up" servers for connectivity: first the LAN router/switch, then the local file server, then the T1 router, then the ISP's DNS, then Google. I tested the latter two as numeric addresses and as domains, to check DNS problems vs ping per se. If any of the pings failed too often, I got an idea of where the problem in connecting to the internet was most likely to exist.

For the numeric address for Google, I just used one I had gotten from nslookup previously - I never ran into a case where it was down. I suppose would be simpler.

Fairly often, when people called to say the "internet was down", it turned out that only DNS was down; we might call those different things, but from the viewpoint of my colleagues, the internet wasn't available in either case.


Try your DNS server, you'll need it anyway (and your ISP's outside connection might be down). It really depends on what you want. If you need to access s specific service, check it.

  • This is only valid if you know that ISPs DNS server is responding to ping. It may well be working but block ICMP.
    – Olli
    Mar 7, 2016 at 13:51
  • This is the simplest and best answer, IMO.
    – njbair
    Sep 22, 2016 at 15:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.