2

I am attempting to set up a simple api subdomain (api.example.com) on my site and am unable to figure out how to do this on Google Domains. I feel as though I have attempted every possible combination of records and hosts.

I am hosing my API on port 80 of an EC2 instance. After configuring the instance, I am able to hit the API on my browser. The following two items typed into my URL bar work correctly:

12.345.678.90

ec2-12-345-678-90.us-west-1.compute.amazonaws.com

Trying to make this a subdomain on Google Domains is not working as expected. The closest I have come to making it work is setting up:

Synthetic Records:

  • Subdomain Forward
  • Subdomain: api.example.com
  • Destination URL: ec2-12-345-678-90.us-west-1.compute.amazonaws.com

This hits the endpoint and returns what is expected, however the URL changes to the Destination url, and does not stay at api.example.com.

I have tried registered hosts, CNAME and A name records, but with no success.

How can I set up a subdomain with Google Domains so that when I type in api.example.com it hits the desired endpoint and the url stays at api.example.com (and doesn't forward to the destination URL)?

Edit:

  • This answer does not help, as it is setting a TXT record.
4
  • You set a CNAME. Then you fix the problem with your web server. Jul 15, 2019 at 17:04
  • Thank you. I will set a CNAME with api. What is "the problem" with the web server?
    – gdomain
    Jul 15, 2019 at 17:05
  • Whatever is causing it to serve the redirect. You didn't supply any information about your web server configuration, so you will need to do that if you want help with it. Jul 15, 2019 at 18:38
  • 1
    @gdomain Were you able to figure this out ? May 10, 2020 at 16:24

0

You must log in to answer this question.

Browse other questions tagged .