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:
- If you want to activate the Azure VM without addressing the DNS issue, see Azure method 1: Activate the Azure VM without using DNS.
- If you want to troubleshoot the Azure VM's connection to the Azure DNS infrastructure, see Azure method 2: Troubleshoot the connection to Azure DNS.
- If your Azure VM connects to custom DNS servers, but it could use Azure DNS instead, see Azure method 3: Reconfigure the Azure VM to use Azure DNS.
- If your Azure VM connects to custom DNS servers, and you have to maintain that configuration, see Azure method 4: Troubleshoot an Azure VM that uses custom DNS.
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 the20.118.99.224address doesn't work, try40.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.
-
On the affected Azure VM, open an administrative Command Prompt window.
-
To check the Azure VM's DNS configuration, run the following command:
ipconfig /allThe output of this command should resemble the following example:
DNS Servers . . . . . . . . . . . : 168.63.129.16[!NOTE]
In this example,168.63.129.16is 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. -
If
168.63.129.16isn'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. -
If the DNS server isn't already set to Default (Azure-provided), select Change, and then select Default (Azure-provided).
-
Restart the Azure VM.
-
On the Azure VM, open an administrative Command Prompt window, and then run the following command:
ipconfig /flushdnsThis command flushes and rebuilds the DNS cache.
-
To try again to activate Windows, run the following command at the command prompt:
cscript c:\windows\system32\slmgr.vbs /ato -
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
-
In the Azure portal, go to Virtual network > DNS servers.
-
Select Change > Default (Azure-provided).
-
Restart the Azure VM.
-
On the Azure VM, open an administrative Command Prompt window, and then run the following command:
ipconfig /flushdnsThis command flushes the DNS cache.
-
To try again to activate Windows, run the following command at the command prompt:
cscript c:\windows\system32\slmgr.vbs /ato -
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
-
To check the Azure VM's DNS configuration, run the following command:
ipconfig /allThe 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.16is 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: -
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
-
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 -
If
pspingfails, follow these steps:-
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.
-
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.
-
To verify that traffic is unblocked, run
pspingagain. -
To flush and rebuild the DNS cache, run the following command:
ipconfig /flushdns -
-
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
- Troubleshoot Azure Windows virtual machine activation problems
- Troubleshooting tools for Windows activation issues on Azure VMs
- Troubleshoot Windows activation error codes
- Configure DNS name resolution for Azure virtual networks
- Azure IP address 168.63.129.16 overview
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.
