From bd957d710fe7538cc49219b7f2311b3af0812ba4 Mon Sep 17 00:00:00 2001 From: sjing Date: Wed, 20 Jul 2011 06:45:30 +0000 Subject: [PATCH] Add stub hint zone for AIX, to handle the scenario where the xcat mn is it's own nameserver and will go no where else for name resolution. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10123 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ddns.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 19ca3b39b..7a5f39907 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -283,6 +283,9 @@ sub process_request { } my %names = (); my $node = $canonical; + + xCAT::SvrUtils::sendmsg(":Handling $node in /etc/hosts.", $callback); + unless ($canonical =~ /$domain/) { $canonical.=$domain; } @@ -785,6 +788,19 @@ sub update_namedconf { #$zfilename =~ s/\..*//; push @newnamed,"\t};\n","\tfile \"db.$zfilename\";\n","};\n\n"; } + + # For AIX, add a hint zone + if (xCAT::Utils->isAIX()) + { + unless (grep(/hint/, @newnamed)) + { + push @newnamed,"zone \"\.\" in {\n","\ttype hint;\n","\tfile \"db\.cache\";\n","};\n\n"; + # Toutch the stub zone file + system("/usr/bin/touch $ctx->{dbdir}.'/db.cache'"); + $ctx->{restartneeded}=1; + } + } + my $newnameconf; open($newnameconf,">>",$namedlocation); flock($newnameconf,LOCK_EX);