How to use your root domain (example.com) as a custom domain

TL;DR
- What you get: your app answering on
your-domain.comandwww.your-domain.com, with HTTPS that renews itself.- Who it's for: anyone launching a product site, shop or SaaS on its own name.
- Time: about 10 minutes of clicking, plus however long your DNS provider takes to publish records (minutes to a few hours).
- Cost: the domain connection and certificate are free on Hubfly space. You only pay for the app itself, and small apps fit in the free tier.
Your app works on a long platform address, and you've bought your-domain.com. Then you hit the wall every launch hits: the subdomain (www) connects in two minutes, but the bare domain won't take a CNAME record. Visitors who type your name without www get an error page, and that's the version people put on business cards.
In this guide you'll connect both, prove you own the domain, and get HTTPS on both names without touching a certificate. It takes one TXT record, one or two routing records, and a click. Try it on Hubfly space while you read; the free tier includes 360 runtime hours a month.
Why the root domain is the hard part
DNS has a rule: a name that has a CNAME record can't have any other record. Your root domain (written @ in most DNS panels) always has other records, like the SOA and NS records that make the domain work, and usually MX records for email. So most providers refuse a CNAME at @. Even where they let you type one, it can break your email.
Providers work around this in two ways:
- ALIAS or ANAME records (offered by Namecheap, DNSimple and others): they behave like a CNAME but are answered as normal address records.
- A records: a fixed IP address. Every DNS provider supports them.
Hubfly space accepts an ALIAS, ANAME or A record at @. The value to use is shown in your domain's setup modal in the dashboard, so always copy it from there rather than from a blog post (including this one).
Step 1: Add your domain and prove you own it
Before Hubfly space routes any traffic for a name, it checks that the name is yours. This stops someone else from claiming your domain on the platform.
- Open dashboard.hubfly.space and click Domains in the bottom navigation bar.
- Under Add domain, type your bare domain, for example
your-domain.com, and click Add. - The domain appears under Your domains with the status Pending, and the Configuration panel shows one TXT record to create.
The Domains page after adding a domain: a Pending status and the TXT record that proves ownership.
The record looks like this. Copy both values with the copy buttons rather than retyping them:
| Type | Host / Name | Value |
|---|---|---|
| TXT | _hubfly-verification (full name _hubfly-verification.your-domain.com) | hubfly-verify=<the code you get> |
- In your DNS provider, add that TXT record. Many panels add your domain automatically, so type only
_hubfly-verificationin the Host field. If you paste the full name, some providers save_hubfly-verification.your-domain.com.your-domain.com, and verification never passes. - Back in Hubfly space, click Verify Connection.
If the record isn't visible yet, the panel says exactly what it looked for:
The message you see when the TXT record isn't published yet.
"Could not find TXT record matching …" means the record isn't public yet or the host is wrong. Wait a few minutes and click Verify Connection again. You can check it yourself from a terminal:
dig +short TXT _hubfly-verification.your-domain.com When the command prints your hubfly-verify=… value, verification will pass.
Step 2: Attach the domain to your app or load balancer
A verified domain still needs a destination. Hubfly space can send it to a single container or to a load balancer.
- Single container: open your project, select the container and open its Networking tab, where you expose your app's port over HTTP and attach your domain.
- Load balancer: if you run several copies of your app, put the domain on the load balancer instead. In the load balancer editor (Topology Studio), ingress domains are wired on the left and your backend containers on the right, so one domain spreads traffic across all of them.
Add www.your-domain.com on the Domains page the same way and attach it too, so both names reach your app.
Step 3: Point DNS at Hubfly space
Now tell the internet where to send visitors. Use the exact values from your domain's setup modal in the dashboard:
| Name | Record type | Value |
|---|---|---|
@ (root) | ALIAS, ANAME or A | the value in your domain's setup modal |
www | CNAME | the target in your domain's setup modal |
If your provider has no ALIAS or ANAME record type, use the A record option. Some providers (Cloudflare, for example) also offer "CNAME flattening" at the root; check that your provider can flatten to the value the dashboard gives you before relying on it.
Keep your existing MX and email TXT records. You're adding records, not replacing the zone.
Step 4: Let HTTPS set itself up
Once DNS points at Hubfly space, the TLS certificate is provisioned automatically and renewed 30 days before it expires. There's no cron job and nothing to upload. When DNS has propagated, open https://your-domain.com and https://www.your-domain.com to check both names.
Pick one name as the main one for search engines and redirect the other to it, so Google doesn't index two copies of your site. Most frameworks do this in a few lines of middleware.
FAQ: can I just use a CNAME at the root?
Usually not. A CNAME can't share a name with other records, and your root always has some. Use ALIAS, ANAME or an A record at @, and keep the CNAME for www.
What can go wrong
- "Could not find TXT record matching …". The record isn't published yet, or the host was saved with your domain twice. Check with
dig(above), fix the host, wait, and verify again. - The site still shows your old host after the switch. Your old A or CNAME record is still in place, or resolvers have cached it. Delete the old record for that name, keep only the one from Step 3, and give caches time to expire.
- Your email stops working after the change. You replaced the root records instead of adding to them, or forced a plain CNAME at
@. Restore your MX and SPF records and use an ALIAS, ANAME or A record for the root.
Limits and pricing, honestly
- Custom domains and certificates are free. Hubfly space charges no domain or certificate fee.
- The app is what you pay for. On the free tier you get 360 runtime hours a month, and a shared container sleeps after 15 minutes without traffic, so the first visit after a quiet spell is slower. An always-on Dedicated container with 0.5 vCPU, 512 MB RAM and 4 GB disk costs:
- CPU: 0.5 × $0.004 × 730 h = $1.46
- RAM: 0.5 GB × $0.002 × 730 h = $0.73
- Disk: 4 GB × $0.00001536 × 730 h = $0.04
- Total: about $2.23 a month.
- Load balancers have no listed fee (free); each target container is billed as above.
- DNS timing isn't in anyone's control. Most records show up in minutes, but providers can take hours.
Who this is not for
- If your site must stay on servers in another cloud, keep your DNS pointed there.
- If you need a wildcard domain (
*.your-domain.com) for customer subdomains, this guide doesn't cover it.
Takeaway
The root domain only feels hard because of one DNS rule. Prove ownership with one TXT record, attach the name to your app or load balancer, use an ALIAS, ANAME or A record at @, and HTTPS takes care of itself.
Read next: Invalid Host header after deploying? Why it happens and the fix (add your new domain to your app's allowed hosts) · Canary releases with a weighted load balancer
Go further on Hubfly space
- Put a sign-in wall in front of a staging domain with Identity Access: Networking docs.
- Run several copies of your app behind one domain with weighted targets: Load balancers.
- Give the app a database it can reach over TLS: Managed Databases.
Start free, 360 hours included. Create your Hubfly space account and put your app on your own name.
