Get advanced public DNS Record with PowerShell


Recently a friend of mine asked me if we can use Web API with PowerShell.Indeed my friend was using StatDNS to make all kind of advanced DNS query and wanted some automation on top of that website.

We came up with a function name “Get-PublicDnsRecord”, based on “Invoke-WebRequest”. You can download it on Technet.

You can use it like that :

    Make some DNS query based on Stat DNS.
    Use Invoke-WebRequest on Stat DNS to resolve DNS query.
    Get-PublicDnsRecord -DomaineNAme "" -DnsRecordType A,MX
    Get-PublicDnsRecord -DomaineNAme "" -DnsRecordType A,MX
.PARAMETER DomaineName
    Domain name to query.
.PARAMETER DnsRecordType
    DNS type to query.

If you have some imagination, you can write a script that uses this function to check all public DNS records required by Office 365 or Exchange.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.