2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OCI DNSのリゾルバで名前解決のフォワーディングのフォワーディング

Last updated at Posted at 2025-10-28

■前提

VCNリゾルバはDNSのクエリをフォワーディングできますが、フォワーディングされたものをリゾルバがさらにフォワーディングできるのかやってみました。
例えば、オンプレミスからHub VCNのリゾルバを通ってSpoke VCNにフォワーディングするといった構成です。
image.png

■構成

VCN2 → On-Premises
VCN21 → Hub VCN
VCN22 → Spoke VCN
の想定で以下の構成です。

image.png

  • VCN2からVCN21を経由してVCN22のプライベートビューを参照したい
  • そのためにリスニングエンドポイント、フォワーディングエンドポイント、フォワーディングルールを設定
  • VCN22のプライベートビューにexample22.comゾーンを作成し、www.example22.com→10.22.0.111というAレコードを追加
  • サブネットはパブリックサブネット
  • サブネットに紐づくルート表は10.0.0.0/8→DRG
  • サブネットに紐づくセキュリティリストはイングレスルール10.0.0.0/8は全許可
  • (後々意味がないと分かったが)VCN2 → VCN22に直接行けないようにDRGルート表を設定
  • 各リゾルバのログを有効化

■コンソールで設定

※メモ程度の内容です

  • VCN2
    VCN2におけるフォワーディングエンドポイントの作成
    image.png
    VCN2におけるフォワーディングルールの作成
    image.png

  • VCN22
    デフォルトプライベートビューにexample22.comゾーンを作成し、www.example22.com→10.22.0.111のAレコードを追加
    image.png

  • 各リゾルバのログの有効化
    image.png

■結果

フォワーディングのフォワーディングは可能でした。

vcn2のインスタンスからnslookup
[opc@ins-vcn2 ~]$ ifconfig
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.2.0.240  netmask 255.255.255.0  broadcast 10.2.0.255

[opc@ins-vcn2 ~]$ nslookup www.example22.com
Server:         169.254.169.254
Address:        169.254.169.254#53

Non-authoritative answer:
Name:   www.example22.com
Address: 10.22.0.111

リゾルバのログ

ログからもフォワーディングされていることが分かります。

(展開ください) VCN2のリゾルバのログ

{
  "datetime": 1761615204846,
  "logContent": {
    "data": {
      "additionalCount": 0,
      "answer": "[A 10.22.0.111]",
      "answerCount": 1,
      "authorityCount": 0,
      "dataschema": "1.1",
      "destinationAddress": "169.254.169.254", ★VCN2のリゾルバ
      "destinationPort": "53",
      "forwardDestinationAddress": "10.21.0.21",   ★VCN21のlisteningエンドポイント
      "forwardDestinationPort": 53,
      "forwardSourceAddress": "10.2.0.2",   ★VCN2のforwardingエンドポイント
      "latency": 10,
      "messageId": 58156,
      "path": "rule:forwarded",
      "protocol": "udp",
      "qclass": "IN",
      "qname": "www.example22.com.",
      "qtype": "A",
      "rcode": "0",
      "rcodeName": "NOERROR",
      "sourceAddress": "10.2.0.240",
      "sourcePort": 35227,
      "ttl": 3600
 ・・・
    "type": "com.oraclecloud.dns.private.resolver"
  },
  "regionId": "ap-osaka-1"
}
(展開ください) VCN21のリゾルバのログ

{
  "datetime": 1761615204843,
  "logContent": {
    "data": {
      "additionalCount": 0,
      "answer": "[A 10.22.0.111]",
      "answerCount": 1,
      "authorityCount": 0,
      "dataschema": "1.1",
      "destinationAddress": "10.21.0.21",  ★VCN21のlisteningエンドポイント
      "destinationPort": "53",
      "forwardDestinationAddress": "10.22.0.22", ★VCN22のlisteningエンドポイント
      "forwardDestinationPort": 53,
      "forwardSourceAddress": "10.21.0.22",  ★VCN21のforwardingエンドポイント
      "latency": 6,
      "messageId": 63732,
      "path": "rule:forwarded",
      "protocol": "udp",
      "qclass": "IN",
      "qname": "www.example22.com.",
      "qtype": "A",
      "rcode": "0",
      "rcodeName": "NOERROR",
      "sourceAddress": "10.2.0.2",
      "ttl": 3600
    },
  ・・・
    "type": "com.oraclecloud.dns.private.resolver"
  }
}
(展開ください) VCN22のリゾルバのログ

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1899411/77367eca-2ac1-4ab9-8911-ac825fca5fc6.png)
{
  "datetime": 1761615204841,
  "logContent": {
    "data": {
      "additionalCount": 0,
      "answer": "[A 10.22.0.111]",
      "answerCount": 1,
      "authorityCount": 0,
      "dataschema": "1.1",
      "destinationAddress": "10.22.0.22",  ★VCN22のリスニングエンドポイント
      "destinationPort": "53",
      "latency": 1,
      "messageId": 56292,
      "path": "private",
      "protocol": "udp",
      "qclass": "IN",
      "qname": "www.example22.com.",
      "qtype": "A",
      "rcode": "0",
      "rcodeName": "NOERROR",
      "sourceAddress": "10.21.0.22",   ★VCN21のforwardingエンドポイント
      "ttl": 3600
    },
  ・・・
    "type": "com.oraclecloud.dns.private.resolver"
  }
}

■代替案

リゾルバにはプライベートビューの関連付けというものがあります。

これを使えば、フォワーディングをしなくてもVCN2のリゾルバだけで名前解決できました。DRGへの通信は発生していません。
image.png

  • コンソールでVCN2リゾルバに対してVCN22のプライベートビューを関連付け
    image.png

  • VCN22プライベートビューに対して、example22associate.comのゾーンを追加し、www.example22associate.com→10.22.0.222のAレコードを追加
    image.png

  • 結果、名前解決できました。

vcn2のインスタンスからnslookup
[opc@ins-vcn2 ~]$ nslookup www.example22associate.com
Server:         169.254.169.254
Address:        169.254.169.254#53

Non-authoritative answer:
Name:   www.example22associate.com
Address: 10.22.0.222
  • VCN2のリゾルバのログ
(展開ください) VCN2のリゾルバのログ

{
  "datetime": 1761620949998,
  "logContent": {
    "data": {
      "additionalCount": 0,
      "answer": "[A 10.22.0.222]",
      "answerCount": 1,
      "authorityCount": 0,
      "dataschema": "1.1",
      "destinationAddress": "169.254.169.254",
      "destinationPort": "53",
      "latency": 1,
      "messageId": 50489,
      "path": "private",
      "protocol": "udp",
      "qclass": "IN",
      "qname": "www.example22associate.com.",
      "qtype": "A",
      "rcode": "0",
      "rcodeName": "NOERROR",
      "sourceAddress": "10.2.0.240",
      "sourcePort": 52827,
      "ttl": 3600
    },
・・・
  "regionId": "ap-osaka-1"
}

(参考)

  • VCN21のリゾルバのログは何もなし
    image.png

  • VCN22のリゾルバのログは何もなし
    image.png

■まとめ

  • フォワーディングされたクエリをさらにフォワーディングすることは可能
  • プライベートビューの関連付けでも同じようなことは可能
2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?