什麼是虛擬網路連結?What is a virtual network link?

一旦在 Azure 中建立私人 DNS 區域,就無法立即從任何虛擬網路存取。Once you create a private DNS zone in Azure, it is not immediately accessible from any virtual network. 您必須將它連結到虛擬網路,然後該網路中所裝載的 VM 才能存取私人 DNS 區域。You must link it to a virtual network before a VM hosted in that network can access the private DNS zone. 若要將私人 DNS 區域連結至虛擬網路,您必須在私人 DNS 區域下建立虛擬網路連結。To link a private DNS zone with a virtual network, you must create a virtual network link under the private DNS zone. 每個私人 DNS 區域都有一組虛擬網路連結子資源。Every private DNS zone has a collection of virtual network link child resources. 這些資源的每一個都代表一個虛擬網路的連接。Each one of these resources represents a connection to a virtual network.

您可以將虛擬網路連結至私人 DNS 區域作為註冊虛擬網路,或連結為解析虛擬網路。You can link a virtual network to a private DNS zone as a registration virtual network or as a resolution virtual network.

註冊虛擬網路Registration virtual network

當您建立私人 DNS 區域和虛擬網路之間 的連結 時,您可以選擇開啟虛擬機器的 DNS 記錄 自動註冊When you create a link between a private DNS zone and a virtual network, you have an option to turn on autoregistration of DNS records for virtual machines. 如果您選擇此選項,則虛擬網路會成為私人 DNS 區域的註冊虛擬網路。If you choose this option, the virtual network becomes a registration virtual network for the private DNS zone. 系統會自動為您部署在網路中的虛擬機器建立 DNS 記錄。A DNS record is automatically created for the virtual machines that you deploy in the network. 系統會為您已在虛擬網路中部署的虛擬機器建立 DNS 記錄。DNS records are created for the virtual machines that you have already deployed in the virtual network. 從虛擬網路的觀點來看,私人 DNS 區域會成為該虛擬網路的註冊區域。From the virtual network perspective, private DNS zone becomes the registration zone for that virtual network. 一個私人 DNS 區域可以有多個註冊虛擬網路,但每個虛擬網路只能有一個相關聯的註冊區域。One private DNS zone can have multiple registration virtual networks, however every virtual network can have exactly one registration zone associated with it.

解析虛擬網路Resolution virtual network

當您在私人 DNS 區域下建立虛擬網路連結,並選擇不啟用 DNS 記錄自動註冊時,會將虛擬網路視為僅解析虛擬網路。When you create a virtual network link under a private DNS zone and choose not to enable DNS record autoregistration, the virtual network is treated as a resolution only virtual network. 在這類網路中部署之虛擬機器的 DNS 記錄,將不會在連結的私人 DNS 區域中自動建立。DNS records for virtual machines deployed in such networks will not be automatically created in the linked private DNS zone. 不過,部署在這類網路中的虛擬機器可以成功查詢私人 DNS 區域中的 DNS 記錄。However, the virtual machines deployed in such a network can successfully query the DNS records from the private DNS zone. 您可以手動建立這些記錄,也可以從已連結為具有私人 DNS 區域之註冊網路的其他虛擬網路來加以填入。These records may be manually created by you or may be populated from other virtual networks that have been linked as registration networks with the private DNS zone. 一個私人 DNS 區域可以有多個解析虛擬網路,而一個虛擬網路可以有多個與其相關聯的解析區域。One private DNS zone can have multiple resolution virtual networks and a virtual network can have multiple resolution zones associated to it.

限制Limits

若要瞭解多少註冊和解析網路,您可以連結至私人 DNS 區域,請參閱 Azure DNS 限制To understand how many registration and resolution networks, you can link to private DNS zones see Azure DNS Limits

其他考量Other considerations

  • 不支援使用傳統部署模型部署的虛擬網路。Virtual networks deployed using classic deployment model are not supported.

  • 您只能在私人 DNS 區域和虛擬網路之間建立一個連結。You can create only one link between a private DNS zone and a virtual network.

  • 私人 DNS 區域下的每個虛擬網路連結,在私人 DNS 區域的內容中都必須有唯一的名稱。Each virtual network link under a private DNS zone must have unique name within the context of the private DNS zone. 您可以在不同的私人 DNS 區域中有相同名稱的連結。You can have links with same name in different private DNS zones.

  • 建立虛擬網路連結之後,請檢查虛擬網路連結資源的 [連結狀態] 欄位。After creating a virtual network link, check the "Link Status" field of the virtual network link resource. 視虛擬網路的大小而定,可能需要幾分鐘的時間,連結才會運作,而連結狀態會變更為 [ 已完成]。Depending on the size of the virtual network, it can take a few minutes before the link is operation and the Link Status changes to Completed.

  • 當您刪除虛擬網路時,會自動刪除在不同私人 DNS 區域中與其相關聯的所有虛擬網路連結和自動註冊的 DNS 記錄。When you delete a virtual network, all the virtual network links and auto-registered DNS records associated with it in different private DNS zones are automatically deleted.

下一步Next steps

  • 瞭解如何使用Azure 入口網站將虛擬網路連結至私人 DNS 區域Learn how to link a virtual network to a private DNS zone using Azure portal

  • 了解如何使用 Azure PowerShellAzure CLI,在 Azure DNS 中建立私人區域。Learn how to create a private zone in Azure DNS by using Azure PowerShell or Azure CLI.

  • 請參閱一些常見私人區域案例,這些案例可在 Azure DNS 中透過私人區域實現。Read about some common private zone scenarios that can be realized with private zones in Azure DNS.

  • 如需 Azure DNS 中私人區域的常見問題和解答,包括特定作業類型預期會有的特定行為,請參閱私人 DNS 常見問題集For common questions and answers about private zones in Azure DNS, including specific behavior you can expect for certain kinds of operations, see Private DNS FAQ.