Get advanced public DNS Record with PowerShell

Hello,

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 :

<#
.SYNOPSIS
    Make some DNS query based on Stat DNS.
.DESCRIPTION
    Use Invoke-WebRequest on Stat DNS to resolve DNS query.
.EXAMPLE
    Get-PublicDnsRecord -DomaineNAme "ItForDummies.net" -DnsRecordType A,MX
.EXAMPLE
    Get-PublicDnsRecord -DomaineNAme "blog.abcloud.fr" -DnsRecordType A,MX
.PARAMETER DomaineName
    Domain name to query.
.PARAMETER DnsRecordType
    DNS type to query.
.LINK
    http://ItForDummies.net
#>

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