In this recipe, we have seen how to host a website without a domain name. The preceding example works best with a domain you manage or own. To make it work with your domain name, you'll have to take the following steps:
- Name the bucket with the domain name, for example: gs://www.example.com.
- Create a CNAME record pointing to c.storage.googleapis.com.
- Set a website configuration for the bucket, to make it behave like a static website:
gsutil web set -m index.html -e 404.html gs://www.example.com