title: nginx resolver -- dns
body: <p>Please excuse a very beginner question. </p>
  
  <p>I'm having trouble understanding the nginx 'resolver' parameter and how it works. I have read the documentation, searched tutorials and posts (using keywords like resolver, nginx, and dns), and I'm still not sure how to apply resolver. </p>
  
  <p><a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver" rel="noreferrer">http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver</a></p>
  
  <p><em>"Configures name servers used to resolve names of upstream servers into addresses...."</em> </p>
  
  <ul>
  <li>By this definition, it seems to be simply doing the nameserver's job.
  <code>resolver ns1.myhost.com ns2.myhost.com;</code> But the examples point to
  an internal/private IP address.</li>
  </ul>
  
  <p><em>"An address can be specified as a domain name or IP address, and an optional port...."</em> </p>
  
  <ul>
  <li>This implies that I could <code>resolver example.com
  www.example.com;</code> (or <code>resolver 12.34.56.78;</code>) but again, I see no such examples in the documentation. </li>
  </ul>
  
  <p>As a practical example, let's say — purely hypothetically :) — that I'm building a simple web server with a couple of server blocks on it. </p>
  
  <p>Do I set 'resolver' to the IP of the server itself? Or an internal IP in the server's LAN? The documentation seems to suggest an internal IP (127.x.x.x or 10.x.x.x) — but how to set/determine what that IP is? </p>