Skip to content

DNS wildcard investigation

$ grep -R odin.cfp *
internal/example-in.zone:*.odin.cfp IN A 10.10.10.9
internal/service-in.zone:*.system.odin.cfp IN A 182.22.64~.10
internal/service-in.zone:*.tcp.odin.cfp IN A 182.22.64.7
$ dig @localhost stg-api-order.book.odin.cfp.example.com +short
182.22.64.9
$ dig @localhost test.book.odin.cfp.example.com +short
182.22.64.9
$ dig @localhost book.odin.cfp.example.com +short
182.22.64.9
$ dig @localhost book.book.odin.cfp.example.com +short
182.22.64.9
$ grep -R odin.cfp *
internal/example-in.zone:*.odin.cfp IN A 182.22.64.9
internal/service-in.zone:*.system.odin.cfp IN A 182.22.64.10
internal/service-in.zone:*.tcp.odin.cfp IN A 182.22.64.7
internal/service-in.zone:stg-api-order.book.odin.cfp IN A 172.17.157.149 <- 追加
$ dig @localhost stg-api-order.book.odin.cfp.example.com +short
172.17.157.149
$ dig @localhost test.book.odin.cfp.example.com +short
$ dig @localhost book.odin.cfp.example.com +short
$ dig @localhost book.book.odin.cfp.example.com +short
$ dig @localhost +short books.odin.cfp.example.com
182.22.64.9

ドメインはロンゲストマッチ 同一階層に同じ名前のドメインが定義されてると、そちらを判定対象にしてしまう(多分) これを回避したい場合、以下の 2 つの対応が必要 *.book.odin.cfp の登録

internal/example-in.zone:*.book.odin.cfp IN A 182.22.64.11

book.odin.cfp の登録

internal/example-in.zone:book.odin.cfp IN A 182.22.64.10
#+end_src>
ひけるようになる
#+begin_src
$ dig @localhost +short test.book.odin.cfp.example.com
182.22.64.11
$ dig @localhost +short book.odin.cfp.example.com
182.22.64.10