Closed dustinschultz closed 6 years ago
So a setting that would imply a maximum TTL? (any received TTL being longer, would be set to the maximum) Or overriding the TTL always?
Overriding the TTL always
On Thu, Jul 12, 2018 at 8:37 PM Thijs Schreijer notifications@github.com wrote:
So a setting that would imply a maximum TTL? (any received TTL being longer, would be set to the maximum) Or overriding the TTL always?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Kong/lua-resty-dns-client/issues/48#issuecomment-404708076, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG4GBKKNBfWDhO5PXdubkwbIjxWLFtLks5uGAgHgaJpZM4VLWWV .
This is indeed similar to the valid
option of the Nginx resolver for which I advocated its implementation around last year or so.
Is this something that could be implemented in the plugin framework? I'm not very experienced with Lua but based on what I was reading here: https://github.com/Kong/lua-resty-dns-client/blob/master/src/resty/dns/client.lua ... it didn't look like it. I wanted to confirm though.
no, it cnnot be implemented in the Kong plugin framework, it must be implemented in this library first. And then add the extra config property to Kong.
I'm currently using Kong with Docker Swarm + the internal docker engine DNS server.
Docker Swarm serves out DNS records with a TTL of 600 and currently offers no way of configuring otherwise. This causes issues when Docker services are updated because they get new IPs within their docker network and if the TTL hasn't expired, the cached entry is used ... causing requests to fail since the service is no longer listening at that location.
It would be great if Docker Swarm offered configurable TTLs but it would also be really nice if there was the ability to override how long a DNS record is valid for, ignoring what is sent by the DNS server.
This feature would be very similar to the NGINX
valid
option that you can add when configuring aresolver
.