LoginSignup
3
2

More than 1 year has passed since last update.

この記事は AWS Advent Calendar 2021 のカレンダー2の7日目の記事です。
昨日は hi1280 さんの GitHub Actionsを使ったECSのデプロイメントパイプライン構築 でした。

はじめに

  • DNSを使う際、ドメインからIPを引く正引きを使うケースが多い。例えばブラウザにURLを入力してWebページを開いたり、Webページのリンクを踏んで別のWebページに遷移したりする時にドメインからIPへの変換が裏で行われている。
  • 一方でメールサーバーからメールを送信したり、Webページをクローリングする際は、相手からするとIPしかわからず、IPから送信元のドメインを辿って送信元を確かめスパムかどうかなど判断したいケースがある。
  • AWSを使用した時にどのように設定していくかを調べてみる。

設定方法

EIPを発行する

  • まずはEIPを発行する。 Screen Shot 2021-12-08 at 21.59.00.png

Screen Shot 2021-12-08 at 22.00.13.png

正引き設定をする

  • Route53からドメイン→IPの正引きを設定する。 Screen Shot 2021-12-08 at 22.02.15.png

逆引き設定をする

  • 逆引き設定前は逆引きしてもAWSのデフォルトのドメインのまま。
❯ nslookup 13.114.215.38
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
38.215.114.13.in-addr.arpa  name = ec2-13-114-215-38.ap-northeast-1.compute.amazonaws.com.

Authoritative answers can be found from:
  • 正引きで設定したものと異なるドメインを設定すると...
    Screen Shot 2021-12-08 at 22.03.31.png

  • エラーとなる。
    Screen Shot 2021-12-08 at 22.05.56.png

  • なので、正引きで設定したドメインを設定する。
    Screen Shot 2021-12-08 at 22.03.20.png

  • 逆引き設定が反映された🙌

❯ nslookup 13.114.215.38                                                                                                                                                     ✘ 1
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
38.215.114.13.in-addr.arpa  name = test.nnhiguchi.com.

Authoritative answers can be found from:

注意

まとめ

  • 逆引き設定は簡単にできるのでメールサーバー作成時やクローリング時などはスパムと誤認されないように設定しておくと良さそう。
3
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
3
2