<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Hello,</div><div><br></div><div>On May 4, 2016, at 7:12 AM, Sem9999 <<a href="mailto:nginx-forum@forum.nginx.org">nginx-forum@forum.nginx.org</a>> wrote:<br><br></div><blockquote type="cite"><span>Hi,</span><br><span></span><br><span>I am trying to connect to my AWS RDS (mysql) instance using the AWS supplied</span><br><span>DNS endpoint.</span><br><span></span><br><span>The problem is, the IP of the instance changes periodically.</span><br><span></span><br><span>It appears that nginx does not resolve the DNS name every time, but caches</span><br><span>it. </span><br><span></span><br><span>Therefore nginx initially works, then at some point later, things break.</span><br><span></span><br><span>How can I turn off the DNS caching?</span><br></blockquote><div><br></div>Add a "valid" parameter to your resolver directive:<div><br></div><div><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">resolver 127.0.0.1 valid=5s;</span></font></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><font face="UICTFontTextStyleBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><br></span></font></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;">This would set it to cache 5s. </pre><br><div><a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver">http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver</a></div></div></div><div><br></div><div>--</div><div>Jim</div></body></html>