Mathew Paret
Mathew Paret

Reputation: 167

DNS_ANY working but DNS_TXT not working for DS_GET_RECORD php function

I am trying to debug dns_get_record since it isn't working for me as expected.

I created a Text DNS record "laramon_59939919ec899.glibix.com." with value "dd678f947384ed8d3531465439ff852e01e6eb1d"

With:

$result=dns_get_record('laramon_59939919ec899.glibix.com.',DNS_TXT);
print_r($result);

I get:

Array
(
)

But with:

$result=dns_get_record('laramon_59939919ec899.glibix.com.',DNS_ANY);
print_r($result);

I get:

Array
(
    [0] => Array
        (
            [host] => laramon_59939919ec899.glibix.com
            [class] => IN
            [ttl] => 86182
            [type] => TXT
            [txt] => dd678f947384ed8d3531465439ff852e01e6eb1d
            [entries] => Array
                (
                    [0] => dd678f947384ed8d3531465439ff852e01e6eb1d
                )

        )

)

The record I have added is of TXT type. Can someone help me understand why do I not get the correct record when I am specifically looking for TXT record?

Upvotes: 0

Views: 998

Answers (1)

Mathew Paret
Mathew Paret

Reputation: 167

Thanks to @NickCoons

The DNS record was being returned from cache. I fixed it by changing DNS_TXT to DNS_ALL. Somehow, it seems like only DNS_TXT is returning the cached result.

Upvotes: 0

Related Questions