0

I have a domain on GoDaddy, and a website hosted on Google Cloud. I have pointed the nameservers to google, and my website works if I go to www.mysite.com but not if I just go to mysite.com. I did the forwarding option through godaddy, so it should redirect, but now the support there is telling me it needs to be done on the Google side since the nameservers are there.

From my SO research so far, I understand it can't be adding records to my DNS (though I'm not sure why), and it can't be done through my bucket. I find it hard to believe this is impossible - is that true? Is there something I can add on my DNS records?

Here's what my records look like on Google Cloud DNS. enter image description here

All the google resources point to GoogleDomains tutorials, but since my domain is on GoDaddy they aren't useful to me.

Big Guy
  • 712
  • 1
  • 8
  • 21
  • You have the subdomain `www` setup using a CNAME. You cannot do the same for the apx (example.com. To set up the apex configure an HTTP(S) Load Balancer: https://cloud.google.com/storage/docs/hosting-static-website#lb-ssl – John Hanley May 24 '21 at 02:28
  • Thank you very much @John, this seems like what I need, but it's not quite working yet. I picked the bucket I used to host the static content, but my website code is in another bucket. When I go to my Cloud DNS, and enter an A record for the Apex, it says "@.example.com" instead of just "@" as the name. This seems wrong but I have no choice, it assumes I want to affect a subdomain. If you understand whats going on help would be much appreciated, but thanks either way. – Big Guy May 24 '21 at 02:56
  • In Cloud DNS, you should create two records: 1) @ A LB_IP_ADDRESS. 2) www A LB_IP_ADDRESS. 3) Then wait for 10 minutes. Configure SSL for your site as well. – John Hanley May 24 '21 at 03:05
  • Hmm, it forces me to append ".example.com" (my DNS name) to any record for the DNS zone I'm using. So the records are like 1) @.example.com A LB_IP_ADDRESS and 2) www A LB_IP_ADDRESS. I also changed the backend bucket to point at the bucket containing my `index.html` and web cod. I'll keep trying – Big Guy May 24 '21 at 03:28
  • Cloud DNS automatically appends the apex name. What do you mean by "forces me to append"? – John Hanley May 24 '21 at 03:30
  • When working with DNS, patience is important. Things do not happen instantly. – John Hanley May 24 '21 at 03:31
  • Have you tried to create another Zone without the www. in the DNS name? – Pit May 26 '21 at 11:29
  • 1
    That would have been a great idea. This wasn't working so I ended up having the domain transferred to Google, and then it was easy to make a synthetic record – Big Guy May 27 '21 at 16:06

1 Answers1

0

You could just create two DNS zones,of public type, one containing www. domain .com. and the other without www.* ,just the domain.com.

Why do you need a single zone for each domain? Because the property name "dnsName" in the API version is a single value. So having multiple DNZ Zones, one for each domain for subdomain could solve your issue.

Or you could just "export a domain" (after being unlocked by third party domain provider) to Google Domains:

From Google Cloud Console go to:

Cloud Domains > Registered Domains > Exports > Confirm Export on the pop-up dialog

Afterwards you could proceed to configure a DNS for the domain. You will have 3 options to configure the DNS for the domain:

  • Cloud DNS, which is the easiest, but it will be charge additionally.
  • Cloud Domains, which has no extra cost but it does not allow API access.
  • Custom name server, it must include 2 of them.
Pit
  • 736
  • 3
  • 17