Powershell query to execute DNS test

matteu31 467 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.
1,021 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,364 questions
0 comments No comments
{count} votes

Accepted answer
  1. Gloria Gu 3,891 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

    0 comments No comments

4 additional answers

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

    You can try Get-DnsServerResourceRecord or just Resolve-DnsName

    0 comments No comments

  2. matteu31 467 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 467 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 :(

    0 comments No comments

  4. AG 0 Reputation points
    2023-02-09T13:31:59.3266667+00:00

    Hi,
    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