diff -Naur dsc-200706121022.orig/collector/dsc/dns_ip_version_index.c dsc-200706121022-ag/collector/dsc/dns_ip_version_index.c
--- dsc-200706121022.orig/collector/dsc/dns_ip_version_index.c	1970-01-01 01:00:00.000000000 +0100
+++ dsc-200706121022-ag/collector/dsc/dns_ip_version_index.c	2007-12-06 10:05:53.530231000 +0100
@@ -0,0 +1,39 @@
+#include <stdlib.h>
+#include <assert.h>
+#include <stdio.h>
+#include <netdb.h>
+
+#include "inX_addr.h"
+#include "dns_message.h"
+#include "md_array.h"
+
+/* This indexer is the same as ip_version_indexer but 
+   applies only to DNS messages. */
+
+static int largest = 0;
+
+int
+dns_ip_version_indexer(const void *vp)
+{
+    const dns_message *m = vp;
+    int i = (int) inXaddr_version(&m->tm->src_ip_addr);
+    if (i > largest)
+	largest = i;
+    return i;
+}
+
+static int next_iter = 0;
+
+int
+dns_ip_version_iterator(char **label)
+{
+    static char label_buf[20];
+    if (NULL == label) {
+	next_iter = 0;
+	return largest + 1;
+    }
+    if (next_iter > largest)
+	return -1;
+    snprintf(*label = label_buf, 20, "IPv%d", next_iter);
+    return next_iter++;
+}
diff -Naur dsc-200706121022.orig/collector/dsc/dns_ip_version_index.h dsc-200706121022-ag/collector/dsc/dns_ip_version_index.h
--- dsc-200706121022.orig/collector/dsc/dns_ip_version_index.h	1970-01-01 01:00:00.000000000 +0100
+++ dsc-200706121022-ag/collector/dsc/dns_ip_version_index.h	2007-12-06 10:01:03.302252000 +0100
@@ -0,0 +1,2 @@
+int dns_ip_version_indexer(const void *);
+int dns_ip_version_iterator(char **label);
diff -Naur dsc-200706121022.orig/collector/dsc/dns_message.c dsc-200706121022-ag/collector/dsc/dns_message.c
--- dsc-200706121022.orig/collector/dsc/dns_message.c	2007-05-15 20:14:01.000000000 +0200
+++ dsc-200706121022-ag/collector/dsc/dns_message.c	2007-12-06 10:01:13.485279000 +0100
@@ -36,6 +36,7 @@
 #include "rd_bit_index.h"
 #include "opcode_index.h"
 #include "transport_index.h"
+#include "dns_ip_version_index.h"
 #include "syslog_debug.h"
 
 extern md_array_printer xml_printer;
@@ -282,6 +283,11 @@
 	*it = transport_iterator;
 	return 1;
     }
+    if (0 == strcmp(in, "dns_ip_version")) {
+	*ix = dns_ip_version_indexer;
+	*it = dns_ip_version_iterator;
+	return 1;
+    }
     syslog(LOG_ERR, "unknown indexer '%s'", in);
     return 0;
 }
diff -Naur dsc-200706121022.orig/collector/dsc/Makefile dsc-200706121022-ag/collector/dsc/Makefile
--- dsc-200706121022.orig/collector/dsc/Makefile	2007-05-15 20:14:01.000000000 +0200
+++ dsc-200706121022-ag/collector/dsc/Makefile	2007-12-06 10:02:20.914680000 +0100
@@ -36,7 +36,8 @@
 	rd_bit_index.o \
 	opcode_index.o \
 	transport_index.o \
+	dns_ip_version_index.o \
 	ParseConfig.o \
 	config_hooks.o \
 	hashtbl.o \
 
