Strange Spf problem

Oct 4, 2013 at 10:38 AM
Hi there, I'm trying to retrive Spf records for a domain, using the following code:
DnsMessage dnsMessage = DnsClient.Default.Resolve(domain, ARSoft.Tools.Net.Dns.RecordType.Spf);
On many domains, this works without problem. However, on a few domains, there is no AnswerRecord in dnsMessage, however I know perfectly well that a Spf record exists on that domain (using other tools, checking the actual DNS records).

If I change the code to:
DnsMessage dnsMessage = DnsClient.Default.Resolve(domain, ARSoft.Tools.Net.Dns.RecordType.Txt);
then the Spf record is returned, however the dnsMessage does NOT contain any AuthorityRecords - if the type is Spf then AuthorityRecords are returned.

Any idea what's going on here?!

AHA, Ben
Oct 4, 2013 at 10:44 AM
Storing SPF data in the DNS TXT is the legacy way to do it.
Still many put their data there and many DNS hosting services don't offer the controls to add a SPF record so TXT is the only option.

The other tools you are using is probably(correctly) checking both TXT and SPF.
Oct 4, 2013 at 2:24 PM
OK, so I'll just check for TXT records then if the Spf comes back empty... Thanks!