Skip to content

Instantly share code, notes, and snippets.

@johnw86
Created September 18, 2020 10:38
Show Gist options
  • Save johnw86/ef94639357268874a9dc5b8f34dbd10c to your computer and use it in GitHub Desktop.
Save johnw86/ef94639357268874a9dc5b8f34dbd10c to your computer and use it in GitHub Desktop.
SFP Lookup
// Using DnsClient nuget package
var client = new LookupClient();
var textRecords = client.Query("google.com", QueryType.TXT).AllRecords.TxtRecords();
var spfRecords = textRecords.Where(x => x.EscapedText.Any(t => t.Contains("spf")));
foreach (var spfRecord in spfRecords)
{
foreach (var text in spfRecord.EscapedText)
{
Console.WriteLine(text);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment