Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Google Cloud provide public hostnames for their Compute instances?

Does Google Cloud provide public hostnames for their Compute instances?

AWS seems to generate public hostnames for their EC2 instances:

A public (external) DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.com for the us-east-1 region, and ec2-public-ipv4-address.region.compute.amazonaws.com for other regions. We resolve a public DNS hostname to the public IPv4 address of the instance outside the network of the instance...

Similar question:
This seems like a similar question but (1) setting up a DNS seems like an overkill, (2) seems like I'll need to do some sort of thing outside of Google Cloud anyway or it isn't public (not sure), and (3) it could be outdated (2014).

like image 985
Hossam El-Deen Avatar asked Dec 04 '18 23:12

Hossam El-Deen


2 Answers

No, GCE doesn't offer hostnames for an instance. It does assign external IP addresses for each instance. Associating a DNS record with your instance is the only method to generate a hostname.

GCE does have built in private hostnames, inside the same network. For example two instances in the same VPC can ping each other by name

Instance 'test-instance': start server on :8080
Instance 'second-instance': curl test-instance:8080
// Response 'Hello World'
like image 164
FridayPush Avatar answered Sep 23 '22 03:09

FridayPush


No. Source: FridayPush's answer (thanks! from his profile, seems worthy of trust for Google-Cloud things :-)).

The reason I wrote a separate answer is to make it clear that you can't have a public hostname totally through Google Cloud. You can either have an internal hostname totally through Google Cloud, or you'll need to do something outside of Google Cloud (e.g., own a domain name) to have a public hostname.

like image 29
Hossam El-Deen Avatar answered Sep 22 '22 03:09

Hossam El-Deen