1

In this page

I mentioned we need to point the A record to load balancer IP.

enter image description here

My website domain.com already have landing page. I want to point api.domain.com to load balancer IP, but I can't set a CName to an IP (it needs to be a domain name), what should I do in this case?

william007
  • 117
  • 5
  • Create a resource record in your DNS server: name api.domain.com, type A, with a value of the IP address of the load balancer. I am not sure why you are mentioning CNAME. – John Hanley Oct 21 '21 at 18:02

2 Answers2

0

I believe this other link could help you to get the process, It is also from the GCP documentation 1 but from the Cloud DNS perspective.

As mentioned there, you will first need to create an A record and pointed either the instance with the public IP for your service or the load balancer IP in order to point your registered domain name to the IP address of the hosting server.

Additionally, you could add a CNAME record if needed, however the first step to follow is add the A record

https://cloud.google.com/dns/docs/tutorials/create-domain-tutorial#set-up-domain

Cristopher
  • 93
  • 4
0

If you want the users of your API to access your portal using a custom domain, you need to configure the Cloud Endpoints Portal and the DNS settings in your domain name registrar. When you add a custom domain to your portal, the Endpoints Portal displays the type of DNS record and other information that you need to configure in your domain name registrar.

In this link, you can find detailed information about setting up a custom domain

One advantage of using an HTTP(S) load balancer is that it gives you more control around your custom domain setup. For example, it allows you to use your own TLS certificate rather than the certificate that is automatically supplied when you use Cloud Run domain mapping. Using the load balancer also lets you route specific URL paths to the Cloud Run service.

Instruction on How Mapping a custom domain to a service here

Regarding to your question about records, this document can be useful to clarify some doubts