How to fixing Incorrect DNS Suffix Resolution in Windows

Share this post on:

When dealing with DNS resolution in an enterprise environment, you might encounter issues where a hostname resolves to an incorrect domain. This usually happens when the DNS suffix search list is not properly configured. In this guide, I will show you how to troubleshoot and fix this issue using PowerShell.

Symptoms of Incorrect DNS Suffix Resolution

You may notice the following:

  • A hostname resolves to a public domain instead of an internal one.
  • Running nslookup returns an unexpected IP address.
  • Your internal domain names are not automatically appended when resolving hostnames.

Example of the Issue

Consider the following scenario:

nslookup SVR-TV01

Output:

Non-authoritative answer:
Name: SVR-TV01.XXX.com
Address: 56.456.324.117

Here, SVR-TV01 is resolving to SVR-TV01.XXX.com, which is incorrect. The expected resolution should be within the internal domain: SVR-TV01.YYY.local.

Solution: Configuring DNS Suffix Search List

To resolve this issue, we can explicitly set the DNS suffix search list using PowerShell:

Step 1: Open PowerShell as Administrator

  1. Click on Start, search for PowerShell
  2. Right-click on Windows PowerShell and select Run as Administrator

Step 2: Configure the DNS Suffix Search List

Run the following command:

Set-DnsClientGlobalSetting -SuffixSearchList @("YYY.local")

This command ensures that when you perform a lookup for a hostname like SVR-TV01, Windows will automatically append YYY.local if no other domain is specified.

Step 3: Verify the Changes

To confirm the new configuration, try running nslookup again:

nslookup SVR-TV01

Expected Output:

Name: SVR-TV01.YYY.local
Address: 192.168.20.20

Now, the hostname correctly resolves to the internal domain, preventing it from pointing to the public domain.

Conclusion

Configuring the DNS suffix search list is a simple yet effective way to ensure proper hostname resolution in a corporate network. By using the Set-DnsClientGlobalSetting command, you can avoid incorrect name resolution issues and ensure that your internal resources are always accessible.

I hope this guide helps you troubleshoot and fix DNS suffix-related issues in your network. Let me know in the comments if you have any questions!

Loading