Monday, May 4, 2009

How to identify if a website is hosted using Google App Engine

If a website is hosted using Google App Engine the following three conditions should hold true:
  • The website's CNAME points to ghs.google.com, ghs.l.google.com or appspot.l.google.com
  • Accessing the website's /form path returns a Google-styled 404 page
  • The website's "Server"-header is "Google Frontend"
The three conditions can easily be tested. On a standard Mac OS X system these commands can be used to test if www.example.com is hosted using Google App Engine:

CNAME google.com:
  dig www.example.com cname | egrep -i 'cname.*google.com'
Google 404 page for /form:
  curl -s -D - http://www.example.com/form | egrep 'G.+o.+o.+g.+l.+e'
"Google Frontend" server string
  curl -s -D - http://www.example.com/ | egrep '^Server:'


Please note that the first two conditions (CNAME + /form) are true also for Blogspot hosted domains, Google Apps hosted domains and possibly other Google hosted services. However, the server string can be used to distinguish between GAE hosted domains (with server string "Google Frontend") and Blogspot/Google Apps domains (with server string "GFE/2.0").

So if all three conditions are true that would strongly indicate that the website is hosted using Google App Engine.

Please let me know if you have any counter-examples - either sites that fulfill the three conditions but are NOT hosted using Google App Engine (false positives), or sites that are hosted using Google App Engine but do not fulfill the three conditions (false negatives).

4 comments:

  1. Why would you want to know if a site is hosted using Google App Engine?
    ReplyDelete
  2. @Chris: If you're developing applications for GAE or considering doing so you might be interested in GAE success stories. I sure am! :-)
    ReplyDelete
  3. Just add Server Spy to Firefox and it'll report 'Google' for sites hosted on GAE.
    ReplyDelete
  4. @GSMD: The server string ("Google Frontend") is a necessary condition, but are you sure it's a sufficient condition?
    ReplyDelete