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

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.