ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.

My application caches reverse lookups of IP addresses. I use DNSServiceQueryRecord() in order to obtain the ttl of the returned record.

Many of the lookups return the same ttl of 4502 which seems erroneous. Requesting the same address repeatedly returns that value when I would expect it to be decreasing.

I submitted a Feedback with sample project attached.

Feedback: FB23574201

Answered by DTS Engineer in 896469022
I would expect it to be decreasing.

That’s not how this API works. Quoting the doc comments in <dns_sd.h>:

The ttl value is not updated when the daemon answers from the cache

What are you trying to do with this value? There may be a better option.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I would expect it to be decreasing.

That’s not how this API works. Quoting the doc comments in <dns_sd.h>:

The ttl value is not updated when the daemon answers from the cache

What are you trying to do with this value? There may be a better option.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.
 
 
Q