Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Feature Request: Ability to override DNS TTL #48

Closed
dustinschultz opened this issue Jul 11, 2018 · 5 comments · Fixed by #57
Closed

Feature Request: Ability to override DNS TTL #48

dustinschultz opened this issue Jul 11, 2018 · 5 comments · Fixed by #57
Assignees

Comments

@dustinschultz
Copy link

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 a resolver.

@dustinschultz dustinschultz changed the title Feature Request: Ability override DNS TTL Feature Request: Ability to override DNS TTL Jul 11, 2018
@Tieske
Copy link
Member

Tieske commented Jul 13, 2018

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?

@dustinschultz
Copy link
Author

dustinschultz commented Jul 13, 2018 via email

@thibaultcha
Copy link
Member

This is indeed similar to the valid option of the Nginx resolver for which I advocated its implementation around last year or so.

@Tieske Tieske self-assigned this Jul 14, 2018
@dustinschultz
Copy link
Author

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.

@Tieske
Copy link
Member

Tieske commented Jul 25, 2018

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.

Tieske added a commit that referenced this issue Aug 23, 2018
Implements a new option `validTtl` that, if given, overrides the
ttl of any valid answer received from the name server.

closes #48
Tieske added a commit that referenced this issue Aug 23, 2018
Implements a new option `validTtl` that, if given, overrides the
ttl of any valid answer received from the name server.

closes #48
Tieske added a commit that referenced this issue Aug 25, 2018
Implements a new option `validTtl` that, if given, overrides the
ttl of any valid answer received from the name server.

closes #48
Tieske added a commit that referenced this issue Aug 25, 2018
Implements a new option `validTtl` that, if given, overrides the
ttl of any valid answer received from the name server.

closes #48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants