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

如何将Namecheap根域名配置到Heroku Hobby级Dyno实例

Got it, let's walk through getting your Namecheap domain asdf.com pointed to your Heroku Hobby app smoothly—since you already have ACM enabled and the app is working at https://asdf.herokuapp.com/, we just need to tie the domain to Heroku and configure DNS correctly.

1. Add Your Domain(s) to Heroku

First, let's register your domain with Heroku so it recognizes it and issues the SSL certificate:

  • Open your Heroku dashboard, navigate to your app's Settings page
  • Scroll down to the Domains and certificates section, click Add domain
  • First, enter your root domain asdf.com and hit Next—Heroku will generate a unique DNS target (looks like xxxx-xxxx-xxxx.herokudns.com). Save this target, you'll need it later.
  • Repeat the process to add the www.asdf.com subdomain, and save its DNS target too.
2. Configure DNS Records in Namecheap

Now let's point your Namecheap domain to Heroku:

  • Log into your Namecheap account, go to your Domain List
  • Find asdf.com and click Manage next to it
  • Switch to the Advanced DNS tab, then set up these records:
    • For the root domain (asdf.com)

      Namecheap doesn't support ALIAS/ANAME records (which are ideal for root domains), so you have two solid options:
      • Option 1 (Recommended): Redirect root to www
        • Add a URL Redirect Record:
          • Host: @
          • Value: https://www.asdf.com/
          • Redirect Type: Permanent (301)
          • TTL: Automatic
      • Option 2: Use Heroku's static IP addresses
        • Note: Heroku's IPs might change occasionally, so you'll need to check for updates if you go this route. Add four A Records:
          • Host: @
          • Value: 50.16.248.154
          • Host: @
          • Value: 50.16.249.154
          • Host: @
          • Value: 50.17.203.154
          • Host: @
          • Value: 54.235.183.154
    • For the www subdomain

      • Add a CNAME Record:
        • Host: www
        • Value: The DNS target Heroku gave you for www.asdf.com (e.g., xxxx-xxxx-xxxx.herokudns.com)
        • TTL: Automatic
  • Don't forget to click Save All Changes at the bottom!
3. Verify SSL Certificate Deployment

Since you have ACM enabled, Heroku will automatically issue an SSL certificate for your new domains once DNS propagates:

  • Head back to your Heroku app's Domains and certificates section
  • You'll see asdf.com and www.asdf.com listed—wait 5-10 minutes (sometimes up to an hour) for a green checkmark to appear next to them, indicating the certificate is active.
  • If it's taking too long, double-check your DNS records with terminal tools:
    • Run dig www.asdf.com CNAME to confirm it points to the correct Heroku DNS target
    • For the root redirect, run curl -I https://asdf.com to ensure it sends a 301 redirect to www.asdf.com
4. Test the Full Setup
  • Give DNS changes 10-15 minutes to propagate (it can take longer depending on your TTL settings)
  • Visit https://www.asdf.com and https://asdf.com—both should load your Heroku app over HTTPS with no certificate errors
  • Quick sanity check: Push a small change to your GitHub repo to confirm the integration still works (domain changes shouldn't affect this, but it's always good to verify)

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.20 07:03:39