# 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.

!!!warning 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:

- <https://portal.azure.com/#browse/Microsoft.Network%2FdnsZones>

**POWERSHELL** Returning DNS Records Using Powershell

Using Module **CCMX.AzGraph.psm1**

1.  GET All **DNS** Records From Azure

``` powershell
$allDNS = Get-XallSchoolDNSRecords
```

1.  GET ALL **SPF** Records

``` powershell
$SPF = Get-XallSchoolSpfRecords
```

1.  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

1.  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

1.  GET ALL **PTR** Records

\#NOTE: PTR records are set by the ISP. Only needed for the public IP address of each site.

``` powershell
$PTR = Get-XallSchoolPtrRecords
```

\#Display

\$PTR \| Format-Table

1.  GET ALL **MX** Records

\#Run point 1 so that \$allDNS is set

``` powershell
$MX = $allDNS | where {$_.RecordType -eq "MX"} | select -exclude Id,ResourceGroupName,Etag,TargetResourceId
```

\#DISPLAY

\$MX \| Format-Table

## Related guidance

- [Topic overview](Introduction.md)
- [Source review status](../../review/Review-status.md)
