3

I am moving from Microsoft Azure to Google Cloud, and I would like to be able to publicly access one of my virtual machines at myapp.uswest.cloudapp.google.com instead of its external, static IP address. I am hoping someone can let me know if I missed something in the setup and if my understanding of what is required is correct.

I went into Google Cloud DNS and created a zone with the DNS name of uswest.cloudapp.google.com and made it a public zone so that it's publicly accessible. Then I created an A record whose value is the external IP address of my virtual machine, and I set the DNS name of that A record to myapp.uswest.cloudapp.google.com.

At this point, do I simply need to wait for the DNS to propagate, or am I missing something?

Alexander
  • 184
  • 1
  • 9
  • 1
    I think I found my answer: https://stackoverflow.com/questions/53623141/does-google-cloud-provide-public-hostnames-for-their-compute-instances/53623414#53623414. It looks like Google Compute Engine doesn't offer hostnames for instances. I'll have to get my own domain set up instead. – Alexander Jan 13 '19 at 04:22

2 Answers2

3

...and create an A record that would resolve against the external IP of your VM

That's not great because the free "ephemeral" address could change in the future.

Microsoft does it better - for your dynamic VM IP address in Azure you can have a free permanent DNS name (something like myapp567.azurewebsites.net) and then just create a CNAME pointing to your own domain (like myapp.mydomain.com).

2

Just posting this answer for anyone having this same issue and in case the stackoverflow answer gets deleted.

The way you had it configured would not work as this name (myapp.uswest.cloudapp.google.com.) will not be recursively resolve. For the very reason that it doesn't create any record under "google.com." for "uswest.cloudapp.google.com" zone.

GCP has internal FQDN for Compute Engine VMs for communicating between instances in the same VPC network, that can be used to send packets to an instance by specifying the fully-qualified DNS name (FQDN) of the target instance. The VPC network automatically resolves the name to the internal IP address of the instance. However, it is not possible to use it externally.

For external communication, you would have to have your own domain (you could register one if you don't have one already) and create an A record that would resolve against the external IP of your VM. However, in this case, you could use Cloud DNS to create a zone for your registered domain.

Nur
  • 386
  • 1
  • 7
  • Thank you very much for providing details on why my solution doesn't work and the real solution! Much appreciated! – Alexander Jan 16 '19 at 05:49