--- bin/named/dlz_ldap_driver.c_ORIG	2005-03-25 20:32:52.000000000 +0100
+++ bin/named/dlz_ldap_driver.c	2005-03-25 20:31:37.000000000 +0100
@@ -587,6 +587,12 @@
 	int i;
 	int entries;
 
+   /* Extended Patch for Zone Extended Tag */
+   char *n_zone_domain;
+   char *n_zone_tld;
+   char n_buffer[strlen(zone)+1];
+
+
 		// get db instance / connection
 #ifdef ISC_PLATFORM_USETHREADS
 
@@ -608,10 +614,29 @@
 		// set fields
 	if(zone != NULL){
 		dbi->zone = isc_mem_strdup(ns_g_mctx, zone);
+ 
+        // Extended Patch for Zone Extended Tag
+        snprintf(n_buffer, strlen(zone)+1, "%s", zone);
+        n_zone_domain = strtok(n_buffer, ".");
+        n_zone_tld    = strtok(NULL, "");
+        //
+        dbi->zone_domain = isc_mem_strdup(ns_g_mctx, n_zone_domain);
+        dbi->zone_tld    = isc_mem_strdup(ns_g_mctx, n_zone_tld);
+
 		if(dbi->zone == NULL){
 			result = ISC_R_NOMEMORY;
 			goto cleanup;
 		}
+        if(dbi->zone_domain == NULL){
+            result = ISC_R_NOMEMORY;
+            goto cleanup;
+        }
+        if(dbi->zone_tld == NULL){
+            result = ISC_R_NOMEMORY;
+            goto cleanup;
+        }
+
+
 	} else {
 		dbi->zone = NULL;
 	}
@@ -822,6 +847,13 @@
 		// cleanup
 	if(dbi->zone != NULL)
 		isc_mem_free(ns_g_mctx, dbi->zone);
+        // free dbi->zone_domain string
+    if(dbi->zone_domain != NULL)
+        isc_mem_free(ns_g_mctx, dbi->zone_domain);
+         // free dbi->zone_tld string
+    if(dbi->zone_tld != NULL)
+        isc_mem_free(ns_g_mctx, dbi->zone_tld);
+
 	if(dbi->record != NULL)
 		isc_mem_free(ns_g_mctx, dbi->record);
 	if(dbi->client != NULL)
