Powershell query to execute DNS test

matteu31 467 Reputation points


I would like to execute DNS query test with powershell but I don't find how to do in powershell DNS commandlets.

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.
1,026 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.
5,414 questions
0 comments No comments
{count} votes

Accepted answer
  1. Gloria Gu 3,891 Reputation points

    @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:

    Hope you have a nice day : )


    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.

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Rich Matheisen 45,186 Reputation points

    You can try Get-DnsServerResourceRecord or just Resolve-DnsName

    0 comments No comments

  2. matteu31 467 Reputation points

    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 467 Reputation points

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

    0 comments No comments

  4. AG 0 Reputation points

    I'm trying to configure the "Perform automatic testing at the following interval" option for both simple and recursive query every 24 hours.
    @Gloria Gu If it isn't possible within a powershell script. How could it be achieved without the GUI?

    There must be a solution to achieve this!
    In the end the GUI also is just setting some flags and/or calling some function(s)...

    0 comments No comments