Powershell query to execute DNS test

matteu31 502 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 for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Answer accepted by question author
  1. Gloria Gu 3,966 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 48,026 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 502 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 502 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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.