diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm
index 6b747a32c..703f6ce95 100644
--- a/xCAT-server/lib/perl/xCAT/Template.pm
+++ b/xCAT-server/lib/perl/xCAT/Template.pm
@@ -219,6 +219,7 @@ sub subvars {
$inc =~ s/#WINTIMEZONE#/xCAT::TZUtils::get_wintimezone()/eg;
$inc =~ s/#WINPRODKEY:([^#]+)#/get_win_prodkey($1)/eg;
$inc =~ s/#WINADJOIN#/windows_join_data()/eg;
+ $inc =~ s/#WINDNSCFG#/windows_dns_cfg()/eg;
$inc =~ s/#WINACCOUNTDATA#/windows_account_data()/eg;
$inc =~ s/#WINDISABLENULLADMIN#/windows_disable_null_admin()/eg;
$inc =~ s/#MANAGEDADDRESSMODE#/managed_address_mode()/eg;
@@ -333,6 +334,35 @@ sub windows_account_data {
$useraccountxml.="\r\n\r\nAdministrators\r\nDomain Admins\r\n\r\n".$domain."\r\n\r\n\r\n";
return $useraccountxml;
}
+sub windows_dns_cfg {
+ my $domain;
+ my $doment;
+ my $noderesent;
+ my $noderestab = xCAT::Table->new("noderes",-create=>0);
+ unless ($noderestab) { return ""; }
+ $noderesent = $noderestab->getNodeAttribs($node,['nameservers'],prefetchcache=>1);
+ unless ($noderesent and $noderesent->{nameservers}) { return ""; }
+ my $nameservers = $noderesent->{nameservers};
+
+ my $domaintab = xCAT::Table->new('domain',-create=>0);
+ if ($domaintab) {
+ $doment = $domaintab->getNodeAttribs($node,['authdomain'],prefetchcache=>1);
+ }
+ if ($doment and $doment->{authdomain}) {
+ $domain = $doment->{authdomain};
+ } else {
+ $domain = $::XCATSITEVALS{domain};
+ }
+ my $componentxml = ''."\r\n$domain\r\n".
+ "\r\n==PRINIC==\r\n\r\n";
+ my $idx=1;
+ foreach (split /,/,$nameservers) {
+ $componentxml.="$_\r\n";
+ $idx+=1;
+ }
+ $componentxml .= "\r\n\r\n\r\n";
+ return $componentxml;
+}
#this will examine table data, decide *if* a Microsoft-Windows-UnattendedJoin is warranted
#there are two variants in how to proceed:
#-Hide domain administrator from node: xCAT will use MACHINEPASSWORD to do joining to AD. Currently requires SSL be enabled on DC. Samba 4 TODO