By design you cannot create a CNAME record in a "root" domain level. It has to point to a subdomain. Unless you're pointing it to other domain.
By design buckets are served using CNAME
record such as www.mysite.com
pointing to c.storage.googleapis.com
.
So you're forced to use www
prefix or other subdomains.
There's a mention in the documentation of a possibility to serve bucket using A
record.
You can use a bucket name in a DNS record as part of a CNAME
or A
redirect which gave me an idea.
But it's a "brittle and hardwired" solution
You need to create bucket named "mysite.com" with the copy of your site.
Then you go to your managed zone and edit A
record to point to the IP of c.storage.googleapis.com
which is 74.125.143.128
(at least at the moment I was writing this). Next you change your CNAME record www.mysite.com
to point to mysite.com
to redirect www
to non www.
Then wait until the changes propagate and you're set :) I tested it and it works. I don't like to wait so I changed TTL's of all records involved to 1 minute.
Then you'd ask yourself why I wrote it's "brittle and hardwired" ? It will work until someone will change the IP of c.storage.googleapis.com
.
Maybe there is some other way to set up DNS records to point to c.storage.googleapis.com instead of IP but I wasn't able to figure this out.
If you don't change your CNAME record and leave it pointing to
c.storage.googleapis.com
then you can have to sites (identical or not it's up to you). One available with www
- other without.