Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>sorry for abusing the answer field for what should probably be a comment but I can't really think of a way to present this info properly otherwise. I honestly don't know yet how to whip them comments into any properly displayed and formatted shape. :-|</p> <p>Anyway, since your code should be working fine but for you it always retuns "everything OK" while you check for a HTTP response, it could be that your ISP is doing <a href="http://en.wikipedia.org/wiki/DNS_hijacking" rel="noreferrer">DNS-highjacking</a>, which basically is returning fake ip-address data, redirecting you to their own server, usually for monetary gains under the guise of userfriendlyness. (ISP-page that shows "this page doesn't exist" combined with ads or the offer of services such as domain registration, etc..)</p> <p>an easy way to test is just to ask for DNS data with an application like <a href="http://linux.die.net/man/1/dig" rel="noreferrer">dig</a>. A query to a properly functioning DNS server for a non-existing domain should return NXDOMAIN as its status:</p> <p>so when we check for a totally fake domain <code>notexisting.fake</code> with the following command: <code>dig A notexisting.fake.</code>, this is what it generally should give:</p> <pre><code>harald@Midians_Gate:~$ dig A notexisting.fake. ; &lt;&lt;&gt;&gt; DiG 9.7.3 &lt;&lt;&gt;&gt; A notexisting.fake. ;; global options: +cmd ;; Got answer: ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NXDOMAIN, id: 28725 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;notexisting.fake. IN A ;; AUTHORITY SECTION: . 1780 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2012061700 1800 900 604800 86400 ;; Query time: 24 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Sun Jun 17 18:05:10 2012 ;; MSG SIZE rcvd: 109 </code></pre> <p>as you can see,asking for this nonexisting domain <code>notexisting.fake.</code> returns us</p> <pre><code>;; Got answer: ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NXDOMAIN, id: 28725 </code></pre> <p>Whereas when we query for google.com, with <code>dig A google.com.</code></p> <pre><code>harald@Midians_Gate:~$ dig A google.com. ; &lt;&lt;&gt;&gt; DiG 9.7.3 &lt;&lt;&gt;&gt; A google.com. ;; global options: +cmd ;; Got answer: ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 13223 ;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;google.com. IN A ;; ANSWER SECTION: google.com. 300 IN A 74.125.132.138 google.com. 300 IN A 74.125.132.139 google.com. 300 IN A 74.125.132.101 google.com. 300 IN A 74.125.132.113 google.com. 300 IN A 74.125.132.100 google.com. 300 IN A 74.125.132.102 ;; Query time: 29 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Sun Jun 17 18:05:20 2012 ;; MSG SIZE rcvd: 124 </code></pre> <p>our query returns us the proper NOERROR</p> <pre><code>;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 13223 ;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0 </code></pre> <p>and returns us the ip address found for the A record</p> <pre><code>;; ANSWER SECTION: google.com. 300 IN A 74.125.132.138 google.com. 300 IN A 74.125.132.139 google.com. 300 IN A 74.125.132.101 google.com. 300 IN A 74.125.132.113 google.com. 300 IN A 74.125.132.100 google.com. 300 IN A 74.125.132.102 </code></pre> <p>So if your query for the fake domain returns an ip address then you know the problem is with your DNS and your isp no doubt redirects every non-existing request to a server of their own, messing with your 'is my site up strategy' since you'll get a 200 OK status but it'll effectively be from an imposter.</p> <p>If this is the case then you can only:</p> <ul> <li>change your DNS server: use <a href="https://developers.google.com/speed/public-dns/" rel="noreferrer">Google Public DNS</a> (8.8.8.8 and 8.8.4.4) or <a href="http://www.opendns.com/" rel="noreferrer">opendns</a> (208.67.222.222 and 208.67.220.220)</li> <li>plead/complain with your isp for them to change this policy or to supply you with your own non-redirecting DNS server</li> <li>run your own private DNS server for your personal lookups if allowed on your network.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload