diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 514627d28..a5a82e037 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -975,6 +975,7 @@ sub getzonesfornet { $netnum = $netnum & 0xffffff00; $netn = pack('N',$netnum); $net = inet_ntoa($netn); + $net =~ s/\.[^\.]*$//; return (join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'); } elsif ($masknum > 0xffff0000) { #class b (/16) to /23 my $tempnumber = ($netnum >> 8); @@ -983,6 +984,7 @@ sub getzonesfornet { foreach ($tempnumber..$highnet) { $netnum = $_ << 8; $net = inet_ntoa(pack('N',$netnum)); + $net =~ s/\.[^\.]*$//; push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'; } return @zones; @@ -993,6 +995,8 @@ sub getzonesfornet { foreach ($tempnumber..$highnet) { $netnum = $_ << 16; #convert back to the real network value $net = inet_ntoa(pack('N',$netnum)); + $net =~ s/\.[^\.]*$//; + $net =~ s/\.[^\.]*$//; push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'; } return @zones; @@ -1003,6 +1007,9 @@ sub getzonesfornet { foreach ($tempnumber..$highnet) { $netnum = $_ << 24; #convert back to the real network value $net = inet_ntoa(pack('N',$netnum)); + $net =~ s/\.[^\.]*$//; + $net =~ s/\.[^\.]*$//; + $net =~ s/\.[^\.]*$//; push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'; } return @zones; diff --git a/xCAT-server/lib/xcat/plugins/dns.pm b/xCAT-server/lib/xcat/plugins/dns.pm index 68d03a7af..f2fdaf140 100644 --- a/xCAT-server/lib/xcat/plugins/dns.pm +++ b/xCAT-server/lib/xcat/plugins/dns.pm @@ -35,6 +35,7 @@ sub getzonesfornet { $netnum = $netnum & 0xffffff00; $netn = pack('N',$netnum); $net = inet_ntoa($netn); + $net =~ s/\.[^\.]*$//; return (join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'); } elsif ($masknum > 0xffff0000) { #(/17) to /23 my $tempnumber = ($netnum >> 8); @@ -43,6 +44,7 @@ sub getzonesfornet { foreach ($tempnumber..$highnet) { $netnum = $_ << 8; $net = inet_ntoa(pack('N',$netnum)); + $net =~ s/\.[^\.]*$//; push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'; } return @zones; @@ -53,6 +55,8 @@ sub getzonesfornet { foreach ($tempnumber..$highnet) { $netnum = $_ << 16; #convert back to the real network value $net = inet_ntoa(pack('N',$netnum)); + $net =~ s/\.[^\.]*$//; + $net =~ s/\.[^\.]*$//; push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'; } return @zones; @@ -63,6 +67,9 @@ sub getzonesfornet { foreach ($tempnumber..$highnet) { $netnum = $_ << 24; #convert back to the real network value $net = inet_ntoa(pack('N',$netnum)); + $net =~ s/\.[^\.]*$//; + $net =~ s/\.[^\.]*$//; + $net =~ s/\.[^\.]*$//; push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.'; } return @zones;