委托 Azure DNS 子域Delegate an Azure DNS subdomain

可以使用 Azure 门户委托 DNS 子域。You can use the Azure portal to delegate a DNS subdomain. 例如,如果拥有 contoso.com 域,可将名为 engineering 的子域委托给另一个可以独立于 contoso.com 区域进行管理的单独区域。For example, if you own the contoso.com domain, you can delegate a subdomain called engineering to another, separate zone that you can administer separately from the contoso.com zone.

如果需要,可以使用 Azure PowerShell 委托子域。If you prefer, you can delegate a subdomain using Azure PowerShell.

必备条件Prerequisites

若要委托 Azure DNS 子域,必须先将公共域委托给 Azure DNS。To delegate an Azure DNS subdomain, you must first delegate your public domain to Azure DNS. 有关如何为委托配置名称服务器的说明,请参阅将域委托给 Azure DNSSee Delegate a domain to Azure DNS for instructions on how to configure your name servers for delegation. 将域委托给 Azure DNS 区域后,可以委托子域。Once your domain is delegated to your Azure DNS zone, you can delegate your subdomain.

Note

本文通篇都使用 contoso.com 作为示例。Contoso.com is used as an example throughout this article. 请将 contoso.com 替换为你自己的域名。Substitute your own domain name for contoso.com.

为子域创建区域Create a zone for your subdomain

首先,为 engineering 域创建区域。First, create the zone for the engineering subdomain.

  1. 在 Azure 门户中,选择“创建资源”。 From the Azure portal, select Create a resource.
  2. 在搜索框中键入 DNS,然后选择“DNS 区域”。 In the search box, type DNS, and select DNS zone.
  3. 选择“创建” 。Select Create.
  4. 在“创建 DNS 区域”窗格中的“名称”文本框内,键入 engineering.contoso.comIn the Create DNS zone pane, type engineering.contoso.com in the Name text box.
  5. 选择区域的资源组。Select the resource group for your zone. 可以使用父区域所在的同一资源组将类似资源放到一起。You might want to use the same resource group as the parent zone to keep similar resources together.
  6. 单击“创建”。 Click Create.
  7. 部署成功后,转到新区域。After the deployment succeeds, go to the new zone.

记下名称服务器Note the name servers

接下来,记下 engineering 子域的四个名称服务器。Next, note the four name servers for the engineering subdomain.

engineering 区域窗格中,记下区域的四个名称服务器。On the engineering zone pane, note the four name servers for the zone. 稍后要使用这些名称服务器。You will use these name servers later.

创建一条测试记录Create a test record

创建用于测试的 A 记录。Create an A record to use for testing. 例如,创建 www A 记录,并为其配置 10.10.10.10 IP 地址。For example, create a www A record and configure it with a 10.10.10.10 IP address.

创建 NS 记录Create an NS record

接下来,为 engineering 区域创建名称服务器 (NS) 记录。Next, create a name server (NS) record for the engineering zone.

  1. 导航到父域的区域。Navigate to the zone for the parent domain.
  2. 选择“+ 记录集”。 Select + Record set.
  3. 在“添加记录集”窗格中的“名称”文本框内,键入 engineeringOn the Add record set pane, type engineering in the Name text box.
  4. 对于“类型”,请选择“NS”。 For Type, select NS.
  5. 在“名称服务器”下,输入前面从 engineering 区域记录的四个名称服务器。 Under Name server, enter the four name servers that you recorded previously from the engineering zone.
  6. 单击“确定”。 Click OK.

测试委托Test the delegation

使用 nslookup 测试委托。Use nslookup to test the delegation.

  1. 打开 PowerShell 窗口。Open a PowerShell window.
  2. 在命令提示符下,键入 nslookup www.engineering.contoso.com.At command prompt, type nslookup www.engineering.contoso.com.
  3. 应会收到一条非权威回复,其中显示了地址 10.10.10.10You should receive a non-authoritative answer showing the address 10.10.10.10.

后续步骤Next steps

了解如何为 Azure 中托管的服务配置反向 DNSLearn how to configure reverse DNS for services hosted in Azure.