Troubleshooting
Custom domain not working or HTTPS not issued
Custom domain not loading or no HTTPS certificate yet? Check your CNAME with dig or nslookup, fix Cloudflare proxy and root domain issues, step by step.
Updated 3 min read
A custom domain on DployHub works once its DNS points at your app's address. The HTTPS certificate is issued automatically right after that, usually within minutes. If your domain still shows an error, nearly every case comes down to one of the DNS problems below. Work through them in order.
Check what your DNS actually says
Before changing anything, look up the record from your own computer. Replace the names with your own domain:
# macOS / Linux
dig +short CNAME www.example.com
dig +short www.example.com
# Windows
nslookup -type=CNAME www.example.comYou should see your environment's address, for example shop.apps.dployhub.com for live or shop-staging.apps.dployhub.com for staging. If you see nothing, an old IP address or a different hostname, the record is wrong or has not propagated yet.
Record missing or pointing elsewhere
- 1
Open the Domains tab
Check the domain is added to the right environment, entered as
www.example.comwith nohttps://and no path. - 2
Edit the record at your DNS provider
Create a CNAME with name
wwwand value set to the environment's address shown in the Domains tab. - 3
Remove conflicts
Delete any A, AAAA or older CNAME record on the same name. Two records for one name confuse resolvers.
- 4
Wait and re-check
Changes usually show within minutes, but DNS can take up to 48 hours. Re-run
diguntil it returns the right value.
Cloudflare: turn off the orange cloud
If your DNS is on Cloudflare and the record is proxied (orange cloud), dig returns Cloudflare's addresses instead of ours, and the certificate cannot be issued. Click the cloud icon so it turns grey ("DNS only") and keep it that way until HTTPS works on your domain.
Root domain (example.com) will not take a CNAME
Most DNS providers do not allow a CNAME on the bare root domain. You have two options:
- Use
www.example.comon DployHub and set up a redirect fromexample.comtowww.example.comat your registrar. - If your provider supports CNAME flattening or ALIAS records, point the root at your environment's address with one of those.
Other common causes
- The domain is already attached elsewhere. A domain can belong to only one app and environment; remove it there first.
- You added the domain to staging but expected it on live, or the other way round. Domains are per environment.
- Django returns "Bad Request (400)": add your custom domain to
ALLOWED_HOSTS, then redeploy. - Browser shows an old error: plain HTTP redirects to HTTPS automatically, so test in a private window to avoid cached redirects.
# Django settings.py
ALLOWED_HOSTS = ["www.example.com", "shop.apps.dployhub.com"]Full setup steps are in custom domains. If dig shows the correct CNAME for more than a few hours and HTTPS still fails, raise a ticket with category Domain/HTTPS.
Frequently asked questions
How long does the HTTPS certificate take?
Usually a few minutes after DNS points to your app. DNS changes themselves can take up to 48 hours to spread.
Can I turn the Cloudflare proxy back on later?
Keep the record on DNS only at least until the certificate is issued and your domain loads over HTTPS.
Do I need to renew the certificate?
No. Certificates are issued and renewed automatically as long as DNS keeps pointing at your app.
Related articles
- Add a custom domain with free automatic HTTPSPoint your own domain at a DployHub app with a CNAME record. HTTPS certificates are issued and renewed automatically, with HTTP redirected to HTTPS.
- Staging and live environments: test, then go liveEvery DployHub app has a free staging environment and a live one. Learn how deploys flow through staging and how Go live promotes the same image.
- Set environment variables for staging and liveAdd API keys, database URLs and other settings as environment variables on DployHub, separately for staging and live, and apply them with a redeploy.
- Raise a support ticket and get help fastHow to raise a DployHub support ticket from the dashboard or the public form, what details to include so we can help quickly, and what each status means.