Search code examples
phpdnsdns-get-record

php dns_get_record ("something.com", DNS_TXT) return false


I am trying to get spf record to validate sender address but function return false for :

$result = dns_get_record('airhelp.com', DNS_ANY);

In mxtoolbox.com I see that site has multi txt records

mxtoolbox txt lookup

Please help me, how could I get those spf (txt) records and please advice me why it isn't working for those domains

UPDATE:

I have discovered that problem exist only for those specific domain and if I query from my local ip...is I query from other ip it works just fine...is it possible that dns rejects my request on the basis of my local ip?


Solution

  • I have found the real problem is that from my local ip (Ukraine) dns_get_record ('airhelp.com', DNS_ANY|DNS_TXT) returns false, while with some other params it works fine ( DNS_SOA|DNS_NS) ...I think it is some dns policy may be...I am interested how to get the reason of failure. –