Tutorials
Bucket Custom Domain

Bucket Custom Domain

A custom domain lets you serve the objects of a bucket from a domain you own, instead of an AIOZ Storage URL.

For example, if your bucket contains an object with the key images/logo.png and you connect the domain cdn.example.com, anyone can open it at:

https://cdn.example.com/images/logo.png

AIOZ Storage issues and renews the HTTPS certificate for your domain automatically. You only need to add two DNS records at your DNS provider.

IMPORTANT: Once a custom domain is active, every object in the bucket is publicly readable at that domain. Anyone who knows or guesses an object key can download it. Only connect a domain to a bucket that holds public content.

Before you start

Make sure you have:

  1. An AIOZ Storage bucket and its bucket passphrase.
  2. A domain (or subdomain) you own, for example example.com or cdn.example.com.
  3. Access to the DNS settings of that domain at your DNS provider (Cloudflare, GoDaddy, Namecheap, Route 53, ...).

Limits:

  • A bucket can have up to 10 custom domains.
  • A domain can be connected to only one bucket at a time.
  • A domain that is already used by a Static Website cannot be used as a custom domain.

Step 1: Open the Custom domains tab

  1. Sign in to AIOZ Storage.
  2. Choose the Buckets tab and open your bucket (enter the bucket passphrase if asked).
  3. Choose the Custom domains tab.
Custom domains tab of a bucket

Step 2: Add your domain

  1. Choose Add Domain.
  2. Enter your domain, for example example.com or cdn.example.com. Do not include https:// or a path.
  3. Tick "I understand every object in this bucket becomes publicly readable at this domain."
  4. Choose Add Domain.
Add Domain dialog

The domain is added with the status Waiting for DNS, and the Custom domain details panel opens with the DNS records you need to create.

Step 3: Add the DNS records

Sign in to your DNS provider and create both records shown in the details panel. Use the copy buttons to avoid typos.

Custom domain waiting for DNS
TypeNameValueWhy it is needed
CNAMEaioz-<random code> (shown in the panel)The target shown in the panelProves that you own the domain.
A@ for a root domain, or the subdomain name (for example cdn)The IP address shown in the panelSends visitors of your domain to AIOZ Storage.

Each record shows a green check (✔) once AIOZ Storage can see it, and a red cross (✘) while it is still missing or wrong.

NOTE: Enter the Name exactly as shown. Most DNS providers add your domain to it automatically, so typing the full name would create aioz-xxxx.example.com.example.com. If your provider asks for the full name (for example Route 53), use the full name shown under it.

Tips for common DNS setups:

  • Cloudflare: set the A record to DNS only (grey cloud). If the record is proxied (orange cloud), the domain cannot be verified and the certificate cannot be issued.
  • Existing records: remove any other A, AAAA or CNAME record that already exists for the same name. A name cannot have a CNAME and an A record at the same time, and an old AAAA record can send some visitors to your old server.
  • Subdomains: use an A record for the subdomain itself (for example cdn), not a CNAME.

Step 4: Wait for verification and the certificate

AIOZ Storage checks your DNS records automatically every few minutes. To check right away, choose Check Now in the details panel (or Check DNS now in the domain list).

DNS changes can take from a few minutes to a few hours to spread, depending on your provider.

  1. When both records are correct, the status changes to Issuing certificate. AIOZ Storage is now creating the HTTPS certificate; this usually takes a few minutes.
Custom domain issuing certificate
  1. When the certificate is ready, the status changes to Active and the domain starts serving your objects.
Active custom domain

NOTE: A domain that is never verified is removed automatically 7 days after it was added. You can add it again at any time.

Step 5: Use your domain

Open any object with the URL https://<your domain>/<object key>. For example, the object images/logo.png is available at:

https://cdn.example.com/images/logo.png

Things to know:

  • The URL path is the object key, including folders.
  • The domain serves single objects. Opening the root (https://cdn.example.com/) or a folder does not list files or show an index page. To host a website with an index page and error pages, use Static Website Hosting instead.
  • Images, videos, audio, PDF and text files are shown in the browser when their content type is known. To control how a file is displayed, set its Content-Type when you upload it.

Domain statuses

StatusMeaningWhat to do
Waiting for DNSThe DNS records are missing or not correct yet.Add both records (Step 3) and wait, or choose Check Now.
Issuing certificateDNS is correct. The HTTPS certificate is being issued.Wait a few minutes.
ActiveThe domain is serving the objects of the bucket.Nothing.
DNS lostThe domain was active, but its DNS records were removed or changed. It no longer serves objects.Restore both DNS records. The domain becomes active again automatically.
DisabledYou disabled the domain. It does not serve objects.Choose Enable to serve again.

Manage your custom domains

Every domain in the Custom domains tab has an action menu:

  • View details: shows the status, the DNS records and the usage of the domain.
  • Check DNS now: checks the DNS records immediately instead of waiting for the next automatic check.
  • Disable: stops serving objects at this domain. The domain stays in the list and you can enable it later.
  • Enable: serves the domain again. A new access key is created for it.
  • Delete: stops serving objects and removes the domain and its access key. You can then remove the DNS records at your DNS provider.

Usage

The Usage section of the details panel shows how much the domain is used over the last 24h, 7d or 30d:

  • Requests: the number of requests served.
  • Data sent: the amount of data downloaded through the domain.
  • Est. cost: the estimated cost of that traffic.

Troubleshooting

The domain stays in "Waiting for DNS".

  • Check that the record Name is not doubled (for example cdn.example.com.example.com). See the note in Step 3.
  • On Cloudflare, make sure the A record is DNS only (grey cloud).
  • Remove old A, AAAA or CNAME records for the same name.
  • DNS changes can take time to spread. Choose Check Now again after a few minutes.

"This domain is already used by another bucket".

The domain is already connected to another bucket. Delete it from that bucket first, or use a different domain or subdomain.

"This bucket has reached its custom domain limit".

The bucket already has 10 custom domains. Delete a domain you no longer use and try again.

The browser downloads a file instead of showing it.

The file was probably uploaded without a content type, or with a type the browser cannot show (for example application/octet-stream). Upload the file again with the correct Content-Type, then open the link in a private window or force a refresh so the browser does not reuse the old response.