From 192d8e77cf97d92aa2b4a3b04aff895a0479d338 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 13 Sep 2011 02:29:29 +0000 Subject: [PATCH] fix for bug 3391271: add dns forwarder into /var/named/db.cache to support dns forwarder on AIX git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10505 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ddns.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 131e48077..198c9cd8e 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -877,6 +877,18 @@ sub update_namedconf { # Toutch the stub zone file system("/usr/bin/touch $ctx->{dbdir}.'/db.cache'"); $ctx->{restartneeded}=1; + if($ctx->{forwarders}) + { + my $dbcachefile = $ctx->{dbdir}.'/db.cache'; + my $cmd = qq~dig @"$ctx->{forwarders}[0]" . ns >> $dbcachefile~; + my $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + my $rsp = {}; + $rsp->{data}->[0] = "Failed to run command: $cmd.\n"; + xCAT::MsgUtils->message("W", $rsp, $callback, 1); + } + } } }