Resolver not working as expected

Maxim Dounin mdounin at mdounin.ru
Wed Aug 29 11:19:47 UTC 2018


Hello!

On Wed, Aug 29, 2018 at 12:25:37PM +0530, Sharan J wrote:

> But, if I remove all the DNS servers from my resolv.conf then, the
> nameserver configured by the "resolver" directive is been used while
> parsing the configuration. Is this an expected behavior?

This depends on your system configuration.  nginx itself 
does not use the DNS servers defined by the "resolver" directive 
during configuration parsing, it uses getaddrinfo() and/or 
gethostbyname() library functions.

Note that resolv.conf is not the only configuration file to 
configure system name resolution - on most systems, there is also 
/etc/nsswitch.conf and /etc/hosts to consider.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx mailing list