- # Loop through the array which contains the file content.
- foreach my $server (@file_content) {
- # Remove newlines.
- chomp($server);
-
- # Check if the current DNS configuration is using the local recursor mode.
- if ($server eq "local recursor") {
- # The responsible DNS servers on red are directly used, and because we are not able
- # to specify each single DNS server address here, we currently have to thread each
- # address which is not part of the HOME_NET as possible DNS server.
- $line = "$line" . "!\$HOME_NET";
- } else {
+ # Check if the current DNS configuration is using the local recursor mode.
+ if ($file_content[0] eq "local" && $file_content[1] eq "recursor") {
+ # The responsible DNS servers on red are directly used, and because we are not able
+ # to specify each single DNS server address here, we currently have to thread each
+ # address which is not part of the HOME_NET as possible DNS server.
+ $line = "$line" . "!\$HOME_NET";
+
+ } else {
+ # Loop through the array which contains the file content.
+ foreach my $server (@file_content) {
+ # Remove newlines.
+ chomp($server);
+