請使用伺服器政策設定 DNS 解析的混合式部署作業。您可以根據 DNS 解析方向設定傳入伺服器政策。如果工作負載預計使用內部部署的 DNS 解析工具,您可以使用傳出連線伺服器政策來設定 DNS 轉送區域。另一方面,如果您希望內部部署的工作負載能夠解析Google Cloud上的名稱,可以設定傳入伺服器政策。
使用回應政策新增自訂規則,修改網路中 DNS 查詢的處理方式。DNS 解析器會在 DNS 查詢期間參照這些規則。回應政策可讓您使用規則 (而非記錄) 自訂私人區域中的 DNS 管理。如果回應政策中的規則會影響傳入的查詢,系統會處理該規則;否則,查詢會照常進行。使用這些規則可獲得類似 DNS 回應政策區域 (RPZ) 草稿概念的結果 (IETF)。如要瞭解如何管理回應政策,請參閱「管理回應政策和規則」。
回應政策與 RPZ 不同,後者是使用特殊格式資料的一般 DNS 區域,可讓相容的解析工具針對查詢提供不同的回應。回應政策不是 DNS 可用區,因此必須分開管理。詳情請參閱「管理回應政策和規則」。
路由政策
針對資源記錄集使用 DNS 轉送政策,根據查詢和其他因素 (例如加權輪替 (WRR)、地理位置或備援) 導引流量。您可以透過 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-09-04 (世界標準時間)。"],[[["\u003cp\u003eCloud DNS offers server policies for configuring private DNS in a Virtual Private Cloud (VPC), including DNS forwarding and logging.\u003c/p\u003e\n"],["\u003cp\u003eResponse policies allow for the customization of DNS query handling within a network by overriding private DNS responses based on the query name.\u003c/p\u003e\n"],["\u003cp\u003eRouting policies direct traffic based on various factors, such as round robin and geolocation, to steer traffic to specific locations or services.\u003c/p\u003e\n"],["\u003cp\u003eAll three types of policies (server, response, and routing) can be implemented simultaneously to fit the specific needs of your network setup.\u003c/p\u003e\n"]]],[],null,["# DNS policies overview\n\nCloud DNS supports different types of policies. This page provides\ndetails about the different policy types and when you can use one or the other.\n\n- **Server policies** apply private DNS configuration to a Virtual Private Cloud (VPC) network (DNS forwarding, logging).\n- **Response policies** override private DNS responses based on the query name.\n- **Routing policies** steer traffic based on the query (for example, round robin, geolocation).\n\nYou can use all three policies at the same time depending on your needs.\n\nServer policies\n---------------\n\nUse server policies to set up hybrid deployments for DNS resolutions. You\ncan set up an inbound server policy depending on the direction of DNS\nresolutions. If your workloads plan to use an on-premises DNS resolver, you can\nset up DNS forwarding zones by using an outbound server policy. On the\nother hand, if you want your on-premises workloads to resolve names on\nGoogle Cloud, you can set up an inbound server policy.\n\nFor more information, see the\n[Server policies overview](/dns/docs/server-policies-overview).\n\nResponse policies\n-----------------\n\nUse response policies to add custom rules that modify how DNS queries are\nhandled within your network. The DNS resolver consults these rules during DNS\nlookups. Response policies let you customize DNS management within a private\nzone by using rules instead of records. If a rule in the response policy affects\nthe incoming query, it is processed; otherwise, the lookup proceeds normally.\nUse these rules to achieve results similar to the DNS [response policy zone\n(RPZ)](https://wikipedia.org/wiki/Response_policy_zone) draft concept\n([IETF](https://datatracker.ietf.org/doc/draft-ietf-dnsop-dns-rpz/)). For\ninformation about how to manage response policies, see [Manage response policies\nand rules](/dns/docs/zones/manage-response-policies).\n\nA response policy is different from an RPZ, which is an otherwise normal DNS\nzone with specially formatted data that causes compatible resolvers to\nprovide different responses to queries. Response policies aren't DNS zones\nand are managed separately. For more information, see\n[Manage response policies and rules](/dns/docs/zones/manage-response-policies).\n\nRouting policies\n----------------\n\nUse DNS routing policies for a resource record set to steer traffic based on\nthe query and other factors, such as weighted round robin (WRR), geolocation,\nor failover. DNS routing policies lets you do the following:\n\n- Steer traffic from a geographical location to a content delivery network (CDN) provider.\n- Route your on-premises traffic to Google Cloud load balancers based on the query's source region.\n- Specify that traffic that originated from a specific continent is served by services in the same continent.\n- Route traffic to different service providers on WRR basis.\n- Onboard new services with a percentage of the total traffic.\n\nFor more information, see [DNS routing policies and health checks](/dns/docs/routing-policies-overview).\n\nWhat's next\n-----------\n\n- [Apply DNS server policies](/dns/docs/policies)\n- [Manage response policies and\n rules](/dns/docs/zones/manage-response-policies)\n- [Manage DNS routing policies and health\n checks](/dns/docs/routing-policies-overview)"]]