nginx/nginx

About dns and resolver

Opened this issue · 2 comments

I want to confirm whether Nginx can run without the host machine having DNS configured, when I use a domain name in an upstream block.

I have set the resolver directive in my Nginx configuration file, but it seems I still need to set up DNS on the host for Nginx to start properly.

Here's my environment:

I'm running Nginx in a Docker container

The host machine does not have DNS configured (I can't even ping www.google.com from it)

I expected that setting resolver in the Nginx config would be sufficient

However, Nginx fails to launch with an '[emerg] host not found in...' error

I expected that setting resolver in the Nginx config would be sufficient

However, Nginx fails to launch with an '[emerg] host not found in...' error

Runtime name resolution with nginx resolver should be enabled explicitly with server ... resolve directive argument in the upstream block.

I expected that setting resolver in the Nginx config would be sufficient
However, Nginx fails to launch with an '[emerg] host not found in...' error

Runtime name resolution with nginx resolver should be enabled explicitly with server ... resolve directive argument in the upstream block.

Thank you, I am trying. It seems can work.