0

I have this problem when forwarding www CNAME to a Google App Engine application. It's not working maybe I am missing something.

Is it possible to forward CNAME to Google App Engine without adding custom domain?

4
  • You want to serve your App Engine app from www.yourdomain.com?
    – MeLight
    Commented Feb 11, 2016 at 7:43
  • what do you mean? What's not working? Are you sure that you've waited enough time to propagate changes to all DNS? Commented Feb 11, 2016 at 7:43
  • @MeLight something like that, but I don't want to setup domain with Google App Engine, I just need to forward the www CNAME to something like subdomain.myapp12345.appspot.com
    – quarks
    Commented Feb 11, 2016 at 7:48
  • @xybrek you already own a domain, so you don't want to buy one from google? Or you don't want to setup your domain with Google App engine? Pretty sure it's impossible without going through Settings >> Custom Domains
    – MeLight
    Commented Feb 11, 2016 at 8:04

1 Answer 1

5

The documentation you linked actually contains the answer to your question: You have to add a custom domain to your app with a wildcard.

And here is the reason why you have to add every domain to your custom domain.

When you create a cname it will always point to ghs.googlehosted.com. My guess is that the servers behind that domain are one huge load balancer, but that's not really important here. What is important is, that before your HTTP request is made the DNS name is resolved to an IP address. The range of IP addresses is the same for all appengine apps, so the server doesn't know that this particular request is intended for your app. However with that IP address a TCP connection is opened to the server. Now you send a request like:

GET / HTTP/1.1
HOST: www.yourcustomdomain.com

The server looks at the HOST part and must decide which app this request should be forwarded to. But it cannot know that if you didn't add your domain to the custom domains of your project. There simply is no information about where to route that request. So the simple answer is:

  • Yes you must add all your custom domains to your project, but you could use wildcards
  • No it will not work without that step, because the Google infrastructure houses tons of apps and your app does not have a dedicated IP address by which it could be identified

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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