By default, nginx caches answers using the TTL value of a response. An
optional|valid|parameter allows overriding it:
resolver 127.0.0.1 [::1]:5353 valid=30s;
Before version 1.1.9, tuning of caching time was not possible, and
nginx always cached answers for the duration of 5 minutes.
Have you also checked that the DNS returns the correct value? As the
valid option means that nginx will ask the DNS server again, but if the
DNS replies with same old ip… Also you might check using directly the
hostname as it might be possible that there is a bug when using
variables.
Note if you have upstream “example.net” defined elsewhere, nginx
will use it, and dynamic DNS resolution will not be used. Note
well that upstream may be defined either explicitly, using
upstream example.net {
...
}
or implicitly, using a proxy_pass to the given name:
proxy_pass http://example.net;
The latter sometimes confuses people trying to use proxy_pass with
variables to trigger dynamic DNS resolution of upstream names.
Quaisquer informações contidas neste e-mail e anexos podem ser
confidenciais e privilegiadas, protegidas por sigilo legal. Qualquer
forma
de utilização deste documento depende de autorização do emissor, sujeito
as
penalidades cabíveis.
Any information in this e-mail and attachments may be confidential and
privileged, protected by legal confidentiality. The use of this document
require authorization by the issuer, subject to penalties.
On Fri, May 13, 2016 at 02:13:05AM -0400, RT.Nat wrote:
Hi there,
why do you think that this does not work?
As in: what request do you make that give you an unexpected response?
And
can you also show the “dig” command that shows that the nominated dns
server has changed the resolution address that it provides?
I tried adding the variable for resolving the dns but still the ip address
does not changes. Is there any other way? or is there any bug in my script.
and the first command shows the remote web server content every few
seconds, while the second command show that a new dns request is made
more than 20 seconds after the previous one:
===
21:31:00.572450 IP 192.168.224.128.52862 > 8.8.8.8.53: 12516+ A? www.example.net. (33)
21:31:00.631578 IP 8.8.8.8.53 > 192.168.224.128.52862: 12516 1/0/0 A
93.184.216.34 (49)
21:31:23.829429 IP 192.168.224.128.52862 > 8.8.8.8.53: 5096+ A? www.example.net. (33)
21:31:23.873474 IP 8.8.8.8.53 > 192.168.224.128.52862: 5096 1/0/0 A
93.184.216.34 (49)
21:31:47.135984 IP 192.168.224.128.52862 > 8.8.8.8.53: 37996+ A? www.example.net. (33)
21:31:47.165754 IP 8.8.8.8.53 > 192.168.224.128.52862: 37996 1/0/0 A
93.184.216.34 (49)
Now, I don’t control the google name server, and I can’t make www.example.net get an updated address at will; but the above does seem
to show that the nginx resolver is making a fresh dns request when it
is supposed to.
You have to configure your nginx to use it like any other module.
For instance,
cd /Downloads/nginx
./configure
–add-module=/Downloads/nginx-upstream-dynamic-servers-master
make
make install
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.