How do I disable DNS Caching and DNS Reverse Lookup in Nginx ?

Maxim Dounin mdounin at mdounin.ru
Thu Jan 2 02:07:01 UTC 2014


Hello!

On Wed, Jan 01, 2014 at 10:54:13AM -0500, linuxr00lz2013 wrote:

> Hello Happy New year and thank you for the reply!
> 
> I dont think thats the cause, because I tried clearing the cache and it was
> still stlow! Is there a special directive that I have to use to get it to
> stop caching?

Unfortunately, there is no magic directive "do it all right".  
There is no DNS caching in nginx which survives configuration 
reload, and there are no reverse DNS lookups in http module at 
all.

Unfortunately, you don't show us real configuration and real logs, 
so basically nobody here can help with debugging, but general tips 
are:

1) Make sure you are testing it right.  This basically means 
you'll have to forget about browsers as they are too complex to be 
usable as testing tools and use telnet or curl for basic tests.  
And make sure to watch logs while doing tests.

2) Make sure you've configured it right.  Make sure to understand 
what you write in your configuration, make sure to test what you 
wrote ("nginx -t" is your friend, as well as error log), and avoid 
stupid mistakes like infinite loops.  See above for recommended 
testing tools.

3) Avoid descriptive terms like "really", "painfully", "awfully" - 
measure instead.  If a request takes 60 milliseconds - it may be 
either really fast or really slow, depeding on use case.  
Moreover, exact numbers are usually help a lot with debugging.  If 
something takes 60 seconds - it usually means that there is 60 
second timeout somewhere (one of configure upstream servers can't 
be reached?).

Happy New Year and happy debugging!

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list