LoginSignup
5
2

More than 5 years have passed since last update.

お名前.comで取得したドメインをHerokuアプリに設定するメモ

Posted at

やりたいこと

Herokuアプリはデフォルトだとこんなドメイン。
https://boiling-atoll-43680.herokuapp.com/
これを自分で取得したドメインに変更したい。
今回はお名前.comでドメインを取得したのでそれのやり方のメモ。

前提

お名前.comでドメインを取得済み
Herokuにアプリをデプロイ済み
Heroku CLI をインストール済み

手順

以下コマンドを実行

$ heroku domains:add www.example.com

Adding www.example.com to ⬢ example-app... done
 ▸    Configure your app's DNS provider to point to the DNS Target
 ▸    www.example.com.herokudns.com.
 ▸    For help, see https://devcenter.heroku.com/articles/custom-domains

The domain www.example.com has been enqueued for addition
 ▸    Run heroku domains:wait 'www.example.com' to wait for completion

次に以下コマンドでDNS Targetという情報を確認

$ heroku domains

ここからはお名前の管理画面

DNS関連機能の設定

スクリーンショット 2017-12-01 17.31.10.png

DNSレコード設定を利用する -> 設定する

スクリーンショット 2017-12-01 17.31.22.png

CNAMEレコードを設定

スクリーンショット 2017-12-01 17.32.11 2.png

以上。
数分したら反映されました。

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2