1

So I've deployed a web server as a VM instance on a google app engine. It's running and I can get to it through the ephemeral ip address. Now I want to point a domain name I have to that VM instance and I am hitting the wall here.

I added a custom domain, but the DNS entry it's injecting is with externally visible IP, which is different from the ephemeral IP of the VM.

My question is, how can I forward all the requests to my web-server running in a VM instance?

Splaktar
  • 5,506
  • 5
  • 43
  • 74
pinkstone
  • 111
  • 2
  • 10
  • you deployed a VM instance on GAE ? Do you mean 'managed VM' ? – koma Jan 29 '15 at 19:26
  • It was one of the "Click to Deploy" SW packages, which just launches a pre-configured VM instance for you. – pinkstone Feb 02 '15 at 18:37
  • 1
    If this is one of those 'click to deploy' SW packages, then you must be running on compute engine, not appengine !? – koma Feb 03 '15 at 09:12

1 Answers1

1

In order to send all requests to your custom domain to your web server running in any Google Compute Engine VM instance (including Managed VMs), you need to add some records to the name servers (NS, or DNS) where your domain is being served out of.

You require a DNS A-record, which has two parts: a prefix (sub-domain), and an IP address.

In case you wish to forward your whole domain (including all sub domains, i.e. *.bar.com) to your VM, you need to specify the domain itself (depending on your DNS provider, usually referred to as @, or blank field) as the prefix / sub-domain, followed by your VM's external IP address (ephemeral or static).

In case you wish to only direct a sub-domain of yours (i.e. foo.bar.com) to the web-hosting instance, the prefix / sub-domain part of the A record has to contain said sub-domain.

Sammy Villoldo
  • 1,086
  • 7
  • 6
  • Yep, and for a dynamically assigned IP (which the ephemeral IP is), I've personally found https://support.google.com/domains/answer/6147083?hl=en useful -- but I'm sure other "dynamic dns" providers are good too, I just have no personal experience w/them. The core idea is to help you automate the DNS updates as your dynamically assigned IP changes. – Alex Martelli Feb 02 '15 at 17:53
  • Sammy, you are right, I can do that(and that's what I am doing from my domain registrar). However this is basically just creating a DNS entry for the ephemeral IP, but my understanding is that google App engine assigns a static IP to your app anyways, and when trying to add a domains through the app engine itself(App Engine -> Settings -> Custom Domains) I can all the needed DNS entries, but that IP is different from my ephemeral IP assigned to the VM instance obviously. I am sure there is a way to forward ports to the VM instance,and that's what I am looking for. – pinkstone Feb 02 '15 at 18:47
  • Alex, DynDNS looks like a hack to me, as there is obviously a direct Domain Management on the App Engine and a static IP assigned to an application. A more proper way looks to me like port forwarding to a VM instance, but I am bit lost on how to do that exactly. – pinkstone Feb 02 '15 at 18:49
  • 1
    @pinkstone - The answer refers to Google Compute Engine instances. The case of App Engine is different: it uses Google's web frontends, not your Compute Engine VM instance. For GAE you need to register your custom domain with Google (as you describe, under Settings -> Custom Domains), as well as entering the CNAME / A records into your domain's DNS server. – Sammy Villoldo Feb 03 '15 at 14:08
  • On ephemeral IPs - In theory, they could change at any time. Practically speaking, they are being assigned to a VM and remain assigned for as long as the VM exists. – Sammy Villoldo Feb 03 '15 at 14:15