[nginx] Resolver: require name servers.

Ruslan Ermilov ru at nginx.com
Thu Jun 14 03:29:42 UTC 2018


details:   http://hg.nginx.org/nginx/rev/faf14dc9ab4d
branches:  
changeset: 7299:faf14dc9ab4d
user:      Ruslan Ermilov <ru at nginx.com>
date:      Wed Jun 13 22:37:49 2018 +0300
description:
Resolver: require name servers.

diffstat:

 src/core/ngx_resolver.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r f37d8fb25de5 -r faf14dc9ab4d src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c	Wed Jun 13 22:37:42 2018 +0300
+++ b/src/core/ngx_resolver.c	Wed Jun 13 22:37:49 2018 +0300
@@ -275,6 +275,11 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_
         }
     }
 
+    if (n && r->connections.nelts == 0) {
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "no name servers defined");
+        return NULL;
+    }
+
     return r;
 }
 


More information about the nginx-devel mailing list