question

matteu31400 avatar image
0 Votes"
matteu31400 asked ·

Powershell query to execute DNS test

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-server-powershellwindows-dhcp-dns
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GloriaGu-MSFT avatar image
0 Votes"
GloriaGu-MSFT answered ·

@matteu31400 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://docs.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://docs.microsoft.com/en-us/answers/articles/67444/email-notifications.html

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered ·

You can try Get-DnsServerResourceRecord or just Resolve-DnsName

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

matteu31400 avatar image
0 Votes"
matteu31400 answered ·

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.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The "Tester" button (or "Test Now", in English) just tests whether or not the DNS server can resolve a name using either (or both) a simple request or a recursive request.

The "simple" test checks whether a name in a zone for which this DNS server is authoritative can be resolved. The "recursive" test checks to see if the server can resolve a name in a zone for which the DNS server isn't authoritative.

The Resolve-DNSName can also do that, as can nslookup. The Get-DnsServerZone can get the zones on a DNS server. You can script your own tests provided you know a resolvable name in each authoritative and non-authoritative zone (and don't forget to include the reverse-lookup zones!). There's no need to "audit" each server and each zone manually because "auditing" isn't what that "Tester" button does.


1 Vote 1 ·
matteu31400 avatar image
0 Votes"
matteu31400 answered ·

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

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.