什么是 Azure DNS 专用区域的自动注册功能What is the autoregistration feature of Azure DNS private zones

Azure DNS 专用区域自动注册功能简化了对虚拟机(部署在虚拟网络中)的 DNS 记录的管理过程。The Azure DNS private zones auto registration feature takes the pain out of DNS record management for virtual machines deployed in a virtual network. 当将虚拟网络与专用 DNS 区域链接并为所有虚拟机启用自动注册时,将自动在专用 DNS 区域中创建虚拟机(部署在虚拟网络中)的 DNS 记录。When you link an virtual network with a private DNS zone and enable auto registration for all the virtual machines, the DNS records for the virtual machines deployed in the virtual network are automatically created in the private DNS zone. 除了前向查找记录(A 记录),该功能还会自动为虚拟机创建反向查找记录(PTR 记录)。In addition to forward look records (A records), reverse lookup records (PTR records) are also automatically created for the virtual machines. 如果将更多虚拟机添加到虚拟网络,则这些虚拟机的 DNS 记录也会在链接的专用 DNS 区域中自动进行创建。If you add more virtual machines to the virtual network, DNS records for these virtual machines are also automatically created in the linked private DNS zone.

删除虚拟机时,虚拟机的 DNS 记录将自动从专用 DNS 区域中删除。When you delete a virtual machine, the DNS records for the virtual machine are automatically deleted from the private DNS zone.

可以通过在创建虚拟网络链接时选择“启用自动注册”选项来启用自动注册。You can enable autoregistration by selecting "Enable auto registration" option while creating a virtual network link.

启用自动注册

限制Restrictions

  • 自动注册仅适用于虚拟机。Autoregistration works only for virtual machines. 对于所有其他资源(如内部负载均衡器等),可以在链接到虚拟网络的专用 DNS 区域中手动创建 DNS 记录。For all other resources like internal load balancers etc., you can create DNS records manually in the private DNS zone linked to the virtual network.
  • 仅为主虚拟机 NIC 自动创建 DNS 记录。DNS records are created automatically only for the primary virtual machine NIC . 如果虚拟机有多个 NIC,则可以手动为其他网络接口创建 DNS 记录。If your virtual machines have more than one NIC, you can manually create the DNS records for other network interfaces.
  • 只有在主虚拟机 NIC 使用 DHCP 的情况下,才自动创建 DNS 记录。DNS records are created automatically only if the primary virtual machine NIC is using DHCP. 如果为某个目的配置了静态 IP 地址(例如,为了使用 Azure 中的多个 IP 地址而这样做),则自动注册不会为该虚拟机创建记录。If static IP addresses are configured (for example, to use multiple IP addresses in Azure), autoregistration doesn't create records for that virtual machine.
  • 不支持 IPv6 自动注册(AAAA 记录)。Autoregistration for IPv6 (AAAA records) is not supported.

后续步骤Next steps

  • 了解如何使用 Azure PowerShellAzure CLI 在 Azure DNS 中创建专用区域。Learn how to create a private zone in Azure DNS 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.