Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Retrieve SPF records for a domain via Cloudflare DoH
$domain = ''
$result = Invoke-RestMethod -Uri "$domain&type=TXT" -Headers @{'accept'='application/dns-json'}
if ($result -ne $null) {
if ($result.answer -ne $null) {
$result.answer | Select-Object -ExpandProperty data | Where-Object {$_ -like '*v=spf1*'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.