We have noticed that sometimes, Windows fails to resolve the domain name when one tries to ping it or do nslookup. Sometimes, when trying to run the nslookup command, they encounter this; however, on other occasions, nslookup works, but pinging the same hostname fails. In this post, we will discuss this issue and see what to do when Windows can’t resolve domain names. We will also discuss this issue in WSL in this post.
Why is my domain not resolving?
Your system may fail to resolve a domain due to the absence of a proper DNS A record pointing to a valid origin IP address, or if a CNAME record in the Cloudflare DNS points to an unresolvable external domain. I suggest checking if the proper records are in place first. If that is not the case, follow the solutions mentioned below.
Fix Windows can’t resolve domain name
If Windows can’t resolve the domain name, first of all, you should try rebooting the server, as the issue can be a glitch. However, if you can’t reboot as it is production or rebooting does not help, follow the solutions mentioned below.
- Try registering DNS manually
- Check the IP configuration
- Allow outgoing DNS requests in the server firewall
- Fix corrupted GPO files
- Reset Network Protocols
Let us talk about them in detail.
1] Try registering DNS manually
Sometimes, a device gets unregistered and reregistered from the backend due to activity or patching. In that case, the client may have to register the device manually on their computer. To do so, open Command Prompt as an administrator and run the following command.
ipconfig /registerdns
Finally, reboot your computer and check if the issue is resolved.
2] Check the IP configuration
We should also look into your computer’s IPv4 configuration and make sure that your NetBIOS Setting corresponds with your DNS configuration. To do this, follow the steps mentioned below.
- Open Server Manager.
- Go to Local Server and then click on the hyperlink next to the Ethernet (or WiFi if you are connected to one).
- Right-click on your network and click on Properties.
- Again click on Properties.
- Look for Internet Protocol Version 4 (TCP/IPv4), select it, and click on Properties.
- Click on Advanced and then go to the Wins tab.
- In the NetBIOS setting, the default selection allows the use of the NetBIOS setting provided by the DHCP server. If a static IP address is used or the DHCP server does not provide a NetBIOS setting, you can enable NetBIOS over TCP/IP to ensure proper functionality. So, select Enable NetBIOS over TCP/IP.
- Click Ok.
Finally, check if the issue is resolved.
3] Allow outgoing DNS requests in the server firewall
Next, we will configure the firewall to allow outgoing DNS requests. This should be done by the server admin or whoever has access to the Server Manager. To do this, follow the steps mentioned below.
- Open the Server Manager.
- Go to Tools > Windows Defender Firewall with Advanced Security.
- Now, from the left side of the window, click on Outbound Rules > New Rule.
- You need to set the Rule Type to Port and click Next.
- Now, in Protocol and Ports, select UDP, and enter 53 as the port number.
- Click on Next.
- Select Allow the connection > Next.
- Select the profile where you want this rule implemented and click Next.
- Name the rule “Outgoing DNS Requests” or anything of your choice and click on Finish.
You can then check if the rule is enabled and listed under Outbound Rules to verify it.
4] Fix Corrupted Local GPO Files
You can encounter this issue if local GPO files are corrupted. Because of this, Windows cannot apply the DNS policy and throws the error in question. We will delete those files and then attempt to implement the GPO changes to resolve them. Follow the steps mentioned below to do the same.
- First of all, open File Explorer and then rename or delete on the client computer C:\Windows\System32\GroupPolicy\Machine\Registry.pol.
- Now, open the Command Prompt as an administrator.
- Run
gpupdate /force
.
This will again apply the Group Policy issued by the server admin. Now see if the issue is resolved.
Read: GPUpdate Force not working on Windows computers
5] Reset Network Protocols
If after forcing the GPO update, you encounter this issue, go ahead and reset the client’s network protocols. To do so, open Command Prompt as an admin and run the following commands.
netsh int ip reset
netsh winsock reset
ipconfig /flushdns
ipconfig /registerdns
Finally, check if the issue is resolved.
Read: Server not operational error when adding User to a trusting domain
Why is my domain name not working?
You need to ensure that your domain name has not expired and that it is registered with a reputable domain name registrar. Check your DNS settings to confirm that they are correct and that your domain name is pointing to the right server or IP address.
Also Read: Windows Firewall not recognizing Domain network.