You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GoDaddy CNAME记录无法适配Heroku DNS目标问题求助

Troubleshooting Your GoDaddy-Heroku Domain Binding Issue

Hey Rodrigo, let's break down the most common issues that could be preventing your www.rodrigoloza.com domain from working properly with your Heroku-hosted Django app. Let's go through each step one by one:

  • Verify DNS Propagation
    Since your TTL is set to 1 hour, DNS changes can take up to that full window to roll out across global servers. To check if your CNAME record is active, run one of these commands in your terminal:

    nslookup www.rodrigoloza.com
    # or
    dig www.rodrigoloza.com CNAME
    

    The output should show rodrigoloza.com.herokudns.com as the canonical name. If it doesn't, wait a bit longer for propagation, or double-check your GoDaddy DNS entry for typos.

  • Confirm Heroku Domain Configuration
    You already ran heroku domains -a rodrigo-blog-123456 to check the association, but make sure the DNS Target listed exactly matches the value you entered in GoDaddy's CNAME record (rodrigoloza.com.herokudns.com). Even a single typo (like missing a .com or extra character) will break the connection.

  • Update Django's ALLOWED_HOSTS
    A super common gotcha with Django apps on Heroku is forgetting to add your custom domain to the ALLOWED_HOSTS setting in settings.py. If this is missing, Django will reject requests from your domain, usually throwing a 400 Bad Request error. Update your setting to look like this:

    ALLOWED_HOSTS = [
        'www.rodrigoloza.com',
        'rodrigo-blog-123456.herokuapp.com'
    ]
    

    After making this change, redeploy your app to Heroku with git push heroku main (or your main branch name).

  • Enable Heroku SSL
    If you're trying to access your domain over HTTPS (which is recommended), you need to ensure Heroku has an SSL certificate for your custom domain. Heroku offers free automated SSL for custom domains—enable it with this command:

    heroku certs:auto:enable -a rodrigo-blog-123456
    

    This will provision a certificate and ensure all requests redirect to HTTPS, avoiding certificate errors or insecure connection warnings.

  • Check for Conflicting DNS Records
    In GoDaddy's DNS manager, make sure there are no other records for the www subdomain (like an A record pointing to an IP address) that might be overriding your CNAME. Delete any duplicate or conflicting entries for www to ensure only your correct CNAME is being used.

  • Clear Browser/Network Cache
    Your browser or local network might be caching old DNS data. Try accessing your domain in a private/incognito window, or test from a different device/network to rule out cached records.

内容的提问来源于stack exchange,提问作者Rodrigo Loza

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:36:56