大网数据广告活动
启动与系统组件

Error 0x8007232A "DNS server failure" when you activate Windows

· 52CE 我爱测

Discusses how to resolve error 0x8007232A ("DNS server failure"). This error occurs if Windows can't contact a DNS server to resolve the Key Management Services (KMS) host address during activation.

Summary

This article helps you resolve error 0x8007232A ("DNS server failure"). This error occurs if Windows can't contact a DNS server to resolve the Key Management Services (KMS) host address during activation. The steps apply to physical computers, on-premises virtual machines (VMs), and Azure VMs, including options to activate or troubleshoot that are specific to Azure VMs.

Symptoms

When you try to activate a Windows system, you see the following error message in Windows Script Host:

**Error: 0x8007232A** DNS server failure.

Cause

This error occurs if the Windows on the affected computer (the KMS client) can't contact a DNS server to resolve the Key Management Services (KMS) host address. Unlike error code 0x8007232B (the DNS name doesn't exist), this error code indicates that the DNS query itself failed because the DNS server is unreachable or not responding.

This error typically occurs in the following scenarios:

  • The client's DNS configuration points to a custom DNS server that's down or unreachable.
  • Firewall rules block DNS traffic on TCP/UDP port 53.
  • On Azure VMs, Network Security Group (NSG) rules block DNS traffic on TCP/UDP port 53.
  • A network virtual appliance (NVA) intercepts and drops DNS traffic.
  • The client is in a network that doesn't have a DNS resolution path to the KMS host.
  • The client's network adapter has an incorrect or empty DNS server configuration.

Resolution

If the affected computer is a physical Windows Server-based or Windows Client-based computer, or a non-Azure VM, see detailed troubleshooting instructions at Guidelines for troubleshooting DNS-related activation issues. For more general help to troubleshoot DNS issues, see DNS troubleshooting guidance.

For best results, install the PsPing tool on the client.

For an Azure VM, the following troubleshooting options are available before you have to resort to complex DNS troubleshooting:

Azure method 1: Activate the Azure VM without using DNS

If you want to only activate the Azure VM and not troubleshoot the DNS issue, follow these steps:

Open an administrative Command Prompt window on the affected Azure VM, and then run the following commands:

cscript c:\windows\system32\slmgr.vbs /skms 20.118.99.224:1688
cscript c:\windows\system32\slmgr.vbs /ato

Note:
If the 20.118.99.224 address doesn't work, try 40.83.235.53. These IP addresses are the ones that are available for the Azure KMS service.

Azure method 2: Troubleshoot the connection to Azure DNS

This method checks whether your Azure VM connects correctly to the Azure DNS infrastructure.

  1. On the affected Azure VM, open an administrative Command Prompt window.

  2. To check the Azure VM's DNS configuration, run the following command:

    ipconfig /all
    

    The output of this command should resemble the following example:

    DNS Servers . . . . . . . . . . . : 168.63.129.16
    

    [!NOTE]
    In this example, 168.63.129.16 is the IP address that Azure VMs use when they connect to the Azure DNS infrastructure. For more information, see Azure IP address 168.63.129.16 overview.

  3. If 168.63.129.16 isn't the first DNS server in the list, or if the list is empty, check the DNS configuration of the virtual network. In the Azure portal, go to Virtual network > DNS servers. The selected option should be Default (Azure-provided).

    [!NOTE]
    It's possible to configure a custom DNS server for a particular network interface. If the virtual network already uses the default DNS configuration, check the Azure VM's network interface.

  4. If the DNS server isn't already set to Default (Azure-provided), select Change, and then select Default (Azure-provided).

  5. Restart the Azure VM.

  6. On the Azure VM, open an administrative Command Prompt window, and then run the following command:

    ipconfig /flushdns
    

    This command flushes and rebuilds the DNS cache.

  7. To try again to activate Windows, run the following command at the command prompt:

    cscript c:\windows\system32\slmgr.vbs /ato
    
  8. If the Azure VM still can't connect to Azure DNS, see Troubleshoot Azure IP connectivity.

Azure method 3: Reconfigure the Azure VM to use Azure DNS

  1. In the Azure portal, go to Virtual network > DNS servers.

  2. Select Change > Default (Azure-provided).

  3. Restart the Azure VM.

  4. On the Azure VM, open an administrative Command Prompt window, and then run the following command:

    ipconfig /flushdns
    

    This command flushes the DNS cache.

  5. To try again to activate Windows, run the following command at the command prompt:

    cscript c:\windows\system32\slmgr.vbs /ato
    
  6. If the Azure VM still can't connect to Azure DNS, see Troubleshoot Azure IP connectivity.

Azure method 4: Troubleshoot an Azure VM that uses custom DNS

If your Azure VM uses a custom or hybrid DNS structure, the issue becomes more complicated to resolve. The following steps help you troubleshoot common DNS issues that Azure VMs might experience. They also refer you to more advanced troubleshooting for DNS issues that might affect activation.

Step 1: Make sure that the Azure VM uses the correct IP addresses for the DNS servers
  1. To check the Azure VM's DNS configuration, run the following command:

    ipconfig /all
    

    The output of this command should resemble the following example:

    DNS Servers . . . . . . . . . . . : 10.0.3.5
                                        10.0.3.4
                                        168.63.129.16
    

    [!NOTE]
    In this example, 168.63.129.16 is the IP address that Azure VMs use when they connect to the Azure DNS infrastructure. The other IP addresses represent custom DNS servers. For more information about custom DNS configurations, see the following articles:

  2. Verify that each of the DNS server addresses is correct. If you have to change any of the addresses, go to the Azure VM's virtual network or network interface page in the Azure portal.

    [!IMPORTANT]
    When you use custom DNS servers for Azure VMs, don't configure the DNS server settings on the Azure VM itself. Specify DNS servers at the level of the network interface or the virtual network.

Step 2: Make sure that DNS traffic can pass between the Azure VM and the DNS servers
  1. To verify that DNS traffic can pass from the Azure VM to the DNS server, run the following command at the command prompt on the Azure VM:

    psping <dns-server-ip>:53
    
  2. If psping fails, follow these steps:

    1. Check any network security groups (NSGs) that might affect the Azure VM (such as NSGs that are set at the network interface, subnet, or virtual network level). Make sure that any NSG allows traffic between the Azure VM and the DNS server on UDP/TCP port 53.

    2. Make sure that any firewall (including Windows Firewall on the Azure VM) allows traffic between the Azure VM and the DNS server on UDP/TCP port 53.

    3. To verify that traffic is unblocked, run psping again.

    4. To flush and rebuild the DNS cache, run the following command:

    ipconfig /flushdns
    
  3. To try again to activate Windows, run the following command at the command prompt:

    cscript c:\windows\system32\slmgr.vbs /ato
    
Step 3: Troubleshoot the general DNS server issue

If the DNS server failure persists, see the following articles for more information about how to troubleshoot DNS:

References

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- ✅ Supported versions of Azure Virtual Machine - ✅ Supported versions of Windows Client - ✅ Supported versions of Windows Server · Source date 05/13/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。