diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 02760f105..0bb0b52d9 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1057,6 +1057,7 @@ passed as argument rather than by table value', " requests it does not know to these servers. Note that the DNS servers on the\n" . " service nodes will ignore this value and always be configured to forward \n" . " to the management node.\n\n" . +" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n" " master: The hostname of the xCAT management node, as known by the nodes.\n\n" . " nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" . " use. This value will end up in the nameserver settings of the\n" . diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 026e55bd8..903c3aea5 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -587,6 +587,18 @@ sub process_request { $ctx->{forwarders} = \@forwarders; } + my @options = xCAT::TableUtils->get_site_attribute("emptyzonesenable"); + my $empty_zones = $options[0]; + if (defined($empty_zones)) { + if ($empty_zones =~ /^yes$|^no$/) { + $ctx->{empty_zones_enable} = $empty_zones; + } else { + my $rsp; + push @{ $rsp->{data} }, "emptyzonesenable from xCAT site table should be yes or no."; + xCAT::MsgUtils->message("E", $rsp, $callback); + return; + } + } my @slave_ips; my $dns_slaves = get_dns_slave(); if (scalar @$dns_slaves) { @@ -1098,6 +1110,8 @@ sub update_namedconf { push @newnamed, "\t\t" . $_ . ";\n"; } push @newnamed, "\t};\n"; + } elsif ($ctx->{empty_zones_enable} and $line =~ /empty-zones-enable/) { + push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; } elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) { push @newnamed, "\tallow-transfer \{\n"; $skip = 1; @@ -1237,6 +1251,10 @@ sub update_namedconf { push @newnamed, "\t};\n"; } + if ($ctx->{empty_zones_enable}){ + push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; + } + if ($slave) { push @newnamed, "\tallow-transfer { any; };\n"; } else {