DNS Records
Look up Azure DNS record-query examples using the custom CCMX.AzGraph.psm1 module. Later filters depend on the initial collection of all DNS records.
Source-derived reference
These notes were recovered from OneNote. Configuration, permissions and operating results have not been freshly verified. Confirm the applicable authority and environment before acting.
Link to AZURE PORTAL DNS SETTINGS:
POWERSHELL Returning DNS Records Using Powershell
Using Module CCMX.AzGraph.psm1
- GET All DNS Records From Azure
$allDNS = Get-XallSchoolDNSRecords
- GET ALL SPF Records
$SPF = Get-XallSchoolSpfRecords
- GET ALL DKIM Records
#Run point 1 so that $allDNS is set $DKIM = $allDNS | where {$_.Name -like "domainkey"} | select -exclude Id,ResourceGroupName,Etag,TargetResourceId | sort ZoneName,Name
#Display $DKIM | Format-Table
- GET ALL DMARC Records
#Run point 1 so that $allDNS is set
$DMARC = $allDNS | where {$_.Name -like "dmarc"} | select -exclude Id,ResourceGroupName,Etag,TargetResourceId | sort ZoneName,Name #Display $DMARC | Format-Table
- GET ALL PTR Records
#NOTE: PTR records are set by the ISP. Only needed for the public IP address of each site.
$PTR = Get-XallSchoolPtrRecords
#Display
$PTR | Format-Table
- GET ALL MX Records
#Run point 1 so that $allDNS is set
$MX = $allDNS | where {$_.RecordType -eq "MX"} | select -exclude Id,ResourceGroupName,Etag,TargetResourceId
#DISPLAY
$MX | Format-Table