4

On creating an EC2 instance on AWS, you can access it via IP address or a domain name provided by Amazon out of the box:

enter image description here

Is there a similar thing available for Google Cloud out of the box? I'm on a network that blocks IP addresses, and wildcard DNS like xip.io, so I was curious to know about it. Also, is there a specific term this is called which I'm missing?

Joss Baron
  • 1,441
  • 10
  • 13
mehulmpt
  • 15,861
  • 12
  • 48
  • 88
  • 1
    I am curious about your company blocking access to external systems via IP addresses. That would break most software and systems. Can you share more details? – John Hanley Dec 05 '19 at 16:31
  • 1
    @JohnHanley nah it's not a company, it's my university here with unnecessary network restrictions, I'm always surfing with vpn or socks enabled, but right now I'm working on an application on GCP for my university itself which won't work as I don't have a domain name associated with the instance, so it kinda got backfired on them only. – mehulmpt Dec 05 '19 at 16:48
  • 2
    1) Get yourself a free domain name https://www.freenom.com that will solve the IP restriction. 2) Get a free Let's Encrypt certificate for your new domain name. 3) I still do not understand how they are blocking IP addresses. Remember that you do not connect to "domain names", you connect to IP addresses. They might be blocking requests that do not have a HTTP Host header (actually SNI: Server Name Indication). – John Hanley Dec 05 '19 at 16:57
  • @JohnHanley yes that's a what I'll do, good suggestion – mehulmpt Dec 05 '19 at 20:04

3 Answers3

1

When you create a GCP Compute Engine instance (EC2 equivalent) you can declare that you want it to have a public IP address. This is an IP that you can use over the Internet to access your instance. GCP gives you two types of IP ... static (stable) or ephemeral. A static IP is yours until you explicitly release it. There is no charge for this as long as your compute engine is running. An ephemeral IP is one which is allocated to you dynamically and may change following a restart of your compute engine instance.

GCP does not (currently ... things could always change) create a DNS entry that will resolve to your IP address over the Internet. It does create a DNS entry that can be used inside your GCP VPC network to allow one compute engine to call another within the GCP environment.

If you want to reach your Compute Engine via a DNS name it is your responsibility to create a DNS "A" record in your own DNS server. If you don't have a DNS server that you can use, then you can obtain a domain name for a few dollars and then create an instance of a GCP Cloud DNS Server and add an "A" record for your compute engine to that server.

See also:

Kolban
  • 13,794
  • 3
  • 38
  • 60
  • I understand cloud DNS, what I was asking if there was a default domain name provided by google, like AWS does in the form ec2-XXX-XXX-XXX-XXX.compute-X.amazonaws.com – mehulmpt Dec 05 '19 at 16:50
  • And the second one is internal DNS, not publicly accessible – mehulmpt Dec 05 '19 at 16:50
  • 1
    Howdy my friend ... sorry ... I wasn't clear. In the second paragraph I wrote "GCP does not (currently ... things could always change) create a DNS entry that will resolve to your IP address over the Internet.". What I meant by this is that NO ... unlike AWS ... the is no default domain name provided by Google for a compute engine exposed to the Internet. It is your responsibility to create a DNS entry somewhere (eg. Cloud DNS or some other DNS provider). – Kolban Dec 05 '19 at 17:09
-1

Yes, you can forumate internal dns for instance using [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal

See the following link for further information: https://cloud.google.com/compute/docs/internal-dns

Parth Mehta
  • 1,869
  • 5
  • 15
  • 1
    That looks like internal DNS, not public. I want the domain to be available publicly (just like aws) – mehulmpt Dec 05 '19 at 16:49
  • GCP does not assign a public dns to your instances. If you own a domain you can create a DNS at the time of creating instance: https://cloud.google.com/compute/docs/instances/custom-hostname-vm – Parth Mehta Dec 05 '19 at 16:58
-1

Please ensure the ports are open. You can visit the documentation as below for your reference, hope this helps. https://cloud.google.com/vpc/docs/firewalls

Johny
  • 1