Powershell query to execute DNS test

matteu31 826 Reputation points
2020-12-08T09:49:26.013+00:00

Hello,

I would like to execute DNS query test with powershell but I don't find how to do in powershell DNS commandlets.
46282-2020-12-08-10h47-30.png

To do this with GUI, you need to go on DNS server properties and analyzis tab and click on test like this picture (sorry, it's french language).
Test-dnsserver doesn't seems to be for this.

Thanks for your help.

Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
925 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,627 questions
No comments
{count} votes

Accepted answer
  1. Gloria Gu 3,811 Reputation points
    2020-12-09T05:40:29.3+00:00

    @matteu31 Hi,

    Thank you for posting in Q&A!

    According to my research and discussion with my colleagues, unfortunately it seems doesn't exist such PS command function the same as this GUI option in windows DNS server.

    nslookup (on Microsoft Windows) are the primary command-line tools for troubleshooting DNS issues.
    You can also use Test-DnsServer to test whether a computer is a functioning Domain Name System (DNS) server. For more details, please refer to:
    https://learn.microsoft.com/en-us/powershell/module/dnsserver/test-dnsserver?view=win10-ps

    Hope you have a nice day : )
    Gloria

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html

    No comments

3 additional answers

Sort by: Most helpful
  1. Rich Matheisen 35,191 Reputation points
    2020-12-08T15:54:22.877+00:00

    You can try Get-DnsServerResourceRecord or just Resolve-DnsName

    No comments

  2. matteu31 826 Reputation points
    2020-12-08T16:59:25.907+00:00

    Thanks for your reply but unfortunately, this doesn't solve my issue.

    I would like exactly what this GUI does because I need to test it on each server for a DNS audit.


  3. matteu31 826 Reputation points
    2020-12-09T14:49:11.707+00:00

    Thanks for your answer.
    I will need to use GUI on all DCs to execute it :(

    No comments