22375d
--- a/common/dns.c	
22375d
+++ a/common/dns.c	
22375d
@@ -1381,6 +1381,24 @@ void ddns_interlude(isc_task_t  *taskp,
22375d
 }
22375d
 
22375d
 /*
22375d
+ * Moved here from omapip/isclib.c, function dhcp_context_create.
22375d
+ * Create dnsclient only before the first use.
22375d
+ */
22375d
+static isc_result_t
22375d
+dns_client_lazy() {
22375d
+	if (dhcp_gbl_ctx.dnsclient == NULL)
22375d
+		return dns_client_createx(dhcp_gbl_ctx.mctx,
22375d
+				    dhcp_gbl_ctx.actx,
22375d
+				    dhcp_gbl_ctx.taskmgr,
22375d
+				    dhcp_gbl_ctx.socketmgr,
22375d
+				    dhcp_gbl_ctx.timermgr,
22375d
+				    0,
22375d
+				    &dhcp_gbl_ctx.dnsclient);
22375d
+	else
22375d
+		return ISC_R_SUCCESS;
22375d
+}
22375d
+
22375d
+/*
22375d
  * This routine does the generic work for sending a ddns message to
22375d
  * modify the forward record (A or AAAA) and calls one of a set of
22375d
  * routines to build the specific message.
22375d
@@ -1403,6 +1421,10 @@ ddns_modify_fwd(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
22375d
 	/* Get a pointer to the clientname to make things easier. */
22375d
 	clientname = (unsigned char *)ddns_cb->fwd_name.data;
22375d
 
22375d
+	result = dns_client_lazy();
22375d
+	if (result != ISC_R_SUCCESS)
22375d
+		return result;
22375d
+
22375d
 	/* Extract and validate the type of the address. */
22375d
 	if (ddns_cb->address.len == 4) {
22375d
 		ddns_cb->address_type = dns_rdatatype_a;
22375d
@@ -1586,6 +1608,10 @@ ddns_modify_ptr(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
22375d
 	unsigned char buf[256];
22375d
 	int buflen;
22375d
 
22375d
+	result = dns_client_lazy();
22375d
+	if (result != ISC_R_SUCCESS)
22375d
+		return result;
22375d
+
22375d
 	/*
22375d
 	 * Try to lookup the zone in the zone cache.  As with the forward
22375d
 	 * case it's okay if we don't have one, the DNS code will try to
22375d
--- a/omapip/isclib.c	
22375d
+++ a/omapip/isclib.c	
22375d
@@ -130,17 +130,7 @@ dhcp_context_create(void) {
22375d
 	if (result != ISC_R_SUCCESS)
22375d
 		goto cleanup;
22375d
 
22375d
-#if defined (NSUPDATE)
22375d
-	result = dns_client_createx(dhcp_gbl_ctx.mctx,
22375d
-				    dhcp_gbl_ctx.actx,
22375d
-				    dhcp_gbl_ctx.taskmgr,
22375d
-				    dhcp_gbl_ctx.socketmgr,
22375d
-				    dhcp_gbl_ctx.timermgr,
22375d
-				    0,
22375d
-				    &dhcp_gbl_ctx.dnsclient);
22375d
-	if (result != ISC_R_SUCCESS)
22375d
-		goto cleanup;
22375d
-#else
22375d
+#if !defined (NSUPDATE)
22375d
 	/* The dst library is inited as part of dns_lib_init, we don't
22375d
 	 * need it if NSUPDATE is enabled */
22375d
 	result = dst_lib_init(dhcp_gbl_ctx.mctx, NULL, 0);