PHP dns_get_record wrong?

I've run into a very strange issue where PHP's dns_get_record() function is returning old results.

On the same server, if I use host or dig from the command line, I get the correct results.

I've even used dig to query each individual nameserver and all return the correct current value for the record.

The servers are running Ubuntu 16.04 and are up-to-date. I haven't tried a reboot yet because these are production boxes.

This is happening on 2 of my servers, not all of them, so it doesn't sounds like a Linode network thing.

Can anyone think of any reason why this would be?

2 Replies

Has there ever been a hosts file entry for that record?

I believe host + dig query the DNS whereas the PHP function uses the system’s resolver which would check the hosts file first.

No - there is no hosts file entry for the domain.

It did resolve itself after many hours, but I still don't understand the mechanism at play here and how to prevent it in future.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct