ngx resolver set custom name server

Maxim Dounin mdounin at
Tue Jul 1 00:10:27 UTC 2014


On Mon, Jun 30, 2014 at 03:43:56PM +0300, Donatas Abraitis wrote:

> Hello,
> is it possible to set resolver (
> writing
> own nginx module?
> I want to set custom name servers for querying by gethostbyaddr(). By
> default gethostbyaddr() uses /etc/resolv.conf, /etc/hosts. I want to
> override this by setting somehow.
> Anyone?

Sorry, but I doubt anyone was able to understand your question.  
At least I wasn't.  You may try to clarify what you want to do and 
what is your question.

Just in case, parameters of the "resolver" directive specify DNS 
servers to use, and it's completely unrelated to system 
gethostbyaddr(), resolv.conf and /etc/hosts.  For an example of 
how to use resolver from an nginx module take a look at 
ngx_http_upstream.c and/or ngx_mail_smtp_handler.c.

Maxim Dounin

More information about the nginx-devel mailing list