什么是虚拟网络链接?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.