1
0
Bryan Drewery 22 жил өмнө
parent
commit
01d096d127

+ 10 - 4
src/mod/dns.mod/coredns.c

@@ -64,10 +64,11 @@ static char *responsecodes[RESPONSECODES_COUNT + 1] = {
 #endif /* DEBUG_DNS */
 
 #ifdef DEBUG_DNS
-#  define RESOURCETYPES_COUNT 17
+#  define RESOURCETYPES_COUNT 18
 static const char *resourcetypes[RESOURCETYPES_COUNT + 1] = {
     "unknown type",
     "A: host address",
+    "AAAA: host address v6",
     "NS: authoritative name server",
     "MD: mail destination (OBSOLETE)",
     "MF: mail forwarder (OBSOLETE)",
@@ -1090,9 +1091,14 @@ static int init_dns_core(void)
 	putlog(LOG_MISC, "*", "No nameservers defined.");
 	return 0;
     }
-    _res.options |= RES_RECURSE | RES_DEFNAMES | RES_DNSRCH;
-    for (i = 0; i < _res.nscount; i++)
-	_res.nsaddr_list[i].sin_family = AF_INET;
+
+    for (i = 0; i < _res.nscount; i++) {
+      char s[102] = "";
+      egg_inet_ntop(AF_INET, &_res.nsaddr_list[i].sin_addr, s, 101);
+      sdprintf("added ns: %s", s);
+      _res.nsaddr_list[i].sin_family = AF_INET;
+    }
+
 
     if (!init_dns_network())
 	return 0;

+ 7 - 13
src/mod/dns.mod/dns.h

@@ -49,19 +49,13 @@ enum resolve_states {
 #define IS_PTR(x) (x->state == STATE_PTRREQ)
 #define IS_A(x)   (x->state == STATE_AREQ)
 
-#ifdef DEBUG_DNS
-# define ddebug0		debug0
-# define ddebug1		debug1
-# define ddebug2		debug2
-# define ddebug3		debug3
-# define ddebug4		debug4
-#else	/* !DEBUG_DNS */
-# define ddebug0(x)
-# define ddebug1(x, x1)
-# define ddebug2(x, x1, x2)
-# define ddebug3(x, x1, x2, x3)
-# define ddebug4(x, x1, x2, x3, x4)
-#endif	/* !DEBUG_DNS */
+#define DEBUG_DNS 1
+
+#define ddebug0(x) sdprintf(x)
+#define ddebug1(x, x1) sdprintf(x, x1)
+#define ddebug2(x, x1, x2) sdprintf(x, x1, x2)
+#define ddebug3(x, x1, x2, x3) sdprintf(x, x1, x2, x3)
+#define ddebug4(x, x1, x2, x3, x4) sdprintf(x, x1, x2, x3, x4)
 
 int dns_report(int, int);
 void dns_hostbyip(IP);