about summary refs log tree commit diff
path: root/resolv/res_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'resolv/res_init.c')
-rw-r--r--resolv/res_init.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 906a2b1571..2d2459d5a3 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -206,12 +206,14 @@ res_init()
 
 #ifdef USELOOPBACK
 	_res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
+	_res.nscount = 1;
+	_res.nsaddr.sin_port = htons(NAMESERVER_PORT);
 #else
 	_res.nsaddr.sin_addr.s_addr = INADDR_ANY;
+	_res.nscount = 0;
+	_res.nsaddr.sin_port = 0;
 #endif
 	_res.nsaddr.sin_family = AF_INET;
-	_res.nsaddr.sin_port = htons(NAMESERVER_PORT);
-	_res.nscount = 1;
 	_res.ndots = 1;
 	_res.pfcode = 0;