Hello!
On Tue, Nov 26, 2013 at 1:09 PM, Andrew Gwozdziewycz wrote:
> I'm having a problem with the lua-resty-memcached client. The documentation
> seems to suggest that it will attempt to resolve hostnames[0],
Well, this has been an FAQ now :)
You need to configure the "resolver" directive in your nginx.conf properly, see
http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
For example, we could use Google's free DNS nameserver by putting the
following line in nginx.conf:
resolver 8.8.8.8;
ngx_lua's cosocket API uses Nginx's own (nonblocking) resolver implementation.
You can also check out the nameservers used by your current system by
checking out the file /etc/resolve.conf:
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
This is the result on my laptop. As you can see, I'm using Google's
two DNS servers for my system resolver as well.
BTW, Nginx's own resolver does not support the /etc/hosts file (yet).
But it's not hard for you to look up this file in your Lua code
yourself ;)
Regards,
-agentzh