如果您希望有多個虛擬私有雲 (VPC) 網路查詢內部部署 DNS 伺服器,則必須在指向內部部署環境的其中一個網路中建立轉送區域。接著,在其他專案中建立對等互連區域,指向用於查詢轉送區域的指定虛擬私有雲網路。兩個虛擬私有雲網路之間的對等互連適用於相同或不同專案。
舉例來說,假設您透過 VPN 通道或 VLAN 連結,將 VPC 網路 A、B 和 C 連線至內部部署網路。您可以在 VPC 網路 A 中建立轉送區域,將要求轉送至內部 DNS 伺服器。接著,您可以為指向轉送區的 VPC 網路 B 和 C 建立對等互連區域。因此,example.com. 的查詢會依據 VPC 網路 A 的名稱解析順序進行解析。
範例
假設您的網域 company.com 在 Google Cloud 控制台中有多個 VPC 網路,且這些網路可能已或未建立 DNS 對等互連。
所有 VPC 網路都必須連線至 DNS 區域 corp.company.com. 中的記錄,以便存取相同的內部 DNS 伺服器組合。
請確認虛擬私有雲網路的 CIDR 範圍不會重疊。
設定
指定單一 VPC 網路,用於傳出 DNS 轉送至內部部署名稱伺服器。例如將其命名為 core-vpc。
在 core-vpc 和內部部署環境之間設定一或多個 VPN 通道或 VLAN 連結。
在專案中建立傳出轉送區域,其中包含 DNS 名稱 corp.company.com. 的 core-vpc。將內部部署名稱伺服器的 IP 位址設為區域的目標。授權 core-vpc 查詢轉送區域。
針對每個其他 VPC 網路,為指向 core-vpc 的 DNS 名稱 corp.company.com.建立 DNS 對等互連區域。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-24 (世界標準時間)。"],[[["This page explains how to configure DNS outbound forwarding for multiple Virtual Private Cloud (VPC) networks to query on-premises DNS servers."],["A designated VPC network with a forwarding zone is required to direct queries to the on-premises environment when multiple VPC networks need to query the same on-premises DNS server."],["Peering zones in other VPC networks can be set up to point to the forwarding zone in the designated VPC network, ensuring consistent name resolution across networks."],["Each VPC network must not have overlapping CIDR ranges, and this solution applies whether the networks are in the same or different projects."],["The designated network requires a connection to the on-premises environment via VPN or VLAN attachments."]]],[]]