How to turn off DNS caching

Hi,

I am trying to connect to my AWS RDS (mysql) instance using the AWS
supplied
DNS endpoint.

The problem is, the IP of the instance changes periodically.

It appears that nginx does not resolve the DNS name every time, but
caches
it.

Therefore nginx initially works, then at some point later, things break.

How can I turn off the DNS caching?

Posted at Nginx Forum:
https://forum.nginx.org/read.php?2,266604,266604#msg-266604

Hello,

On May 4, 2016, at 7:12 AM, Sem9999 [email protected] wrote:

Therefore nginx initially works, then at some point later, things break.

How can I turn off the DNS caching?

Add a “valid” parameter to your resolver directive:

resolver 127.0.0.1 valid=5s;

This would set it to cache 5s.

http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs