2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2020 IPFire Development Team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
25 # enable only the following on debugging purpose
27 #use CGI::Carp 'fatalsToBrowser';
29 require '/var/ipfire/general-functions.pl';
30 require "${General::swroot}/geoip-functions.pl";
31 require "${General::swroot}/ids-functions.pl";
32 require "${General::swroot}/lang.pl";
33 require "${General::swroot}/header.pl";
35 #workaround to suppress a warning when a variable is used only once
36 my @dummy = ( ${Header
::colouryellow
} );
42 my $errormessage = '';
44 # Config file which stores the DNS settings.
45 my $settings_file = "${General::swroot}/dns/settings";
47 # File which stores the configured DNS-Servers.
48 my $servers_file = "${General::swroot}/dns/servers";
50 # Create files if the does not exist.
51 unless (-f
$settings_file) { system("touch $settings_file") };
52 unless (-f
$servers_file) { system("touch $servers_file") };
54 # File which stores the ISP assigned DNS servers.
55 my @ISP_nameserver_files = ( "/var/run/dns1", "/var/run/dns2" );
57 # File which contains the ca-certificates.
58 my $ca_certs_file = "/etc/ssl/certs/ca-bundle.crt";
60 # Server which is used, to determine if the whole DNS system works properly.
61 my $dns_test_server = "ping.ipfire.org";
66 my %mainsettings = ();
67 &General
::readhash
("${General::swroot}/main/settings", \
%mainsettings);
68 &General
::readhash
("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \
%color);
70 &Header
::showhttpheaders
();
71 &Header
::getcgihash
(\
%cgiparams);
74 # Save general settings.
76 if ($cgiparams{'GENERAL'} eq $Lang::tr
{'save'}) {
77 # Prevent form name from been stored in conf file.
78 delete $cgiparams{'GENERAL'};
80 # Add value for non-checked checkbox.
81 if ($cgiparams{'USE_ISP_NAMESERVERS'} ne "on") {
82 $cgiparams{'USE_ISP_NAMESERVERS'} = "off";
85 # Add value for non-checked checkbox.
86 if ($cgiparams{'ENABLE_SAFE_SEARCH'} ne "on") {
87 $cgiparams{'ENABLE_SAFE_SEARCH'} = "off";
90 # Store settings into settings file.
91 &General
::writehash
("$settings_file", \
%cgiparams);
93 # Call function to handle unbound restart, etc.
94 &_handle_unbound_and_more
()
100 if (($cgiparams{'SERVERS'} eq $Lang::tr
{'save'}) || ($cgiparams{'SERVERS'} eq $Lang::tr
{'update'})) {
101 # Hash to store the generic DNS settings.
104 # Read-in generic settings.
105 &General
::readhash
("$settings_file", \
%settings);
107 # Check if an IP-address has been given.
108 if ($cgiparams{"NAMESERVER"} eq "") {
109 $errormessage = "$Lang::tr{'dns no address given'}";
112 # Check if the given DNS server is valid.
113 elsif(!&General
::validip
($cgiparams{"NAMESERVER"})) {
114 $errormessage = "$Lang::tr{'invalid ip'}: $cgiparams{'NAMESERVER'}";
117 # Check if a TLS is enabled and no TLS_HOSTNAME has benn specified.
118 elsif($settings{'PROTO'} eq "TLS") {
119 unless($cgiparams{"TLS_HOSTNAME"}) {
120 $errormessage = "$Lang::tr{'dns no tls hostname given'}";
122 # Check if the provided domain is valid.
123 unless(&General
::validfqdn
($cgiparams{"TLS_HOSTNAME"})) {
124 $errormessage = "$Lang::tr{'invalid ip or hostname'}: $cgiparams{'TLS_HOSTNAME'}";
129 # Go further if there was no error.
130 if ( ! $errormessage) {
131 # Check if a remark has been entered.
132 $cgiparams{'REMARK'} = &Header
::cleanhtml
($cgiparams{'REMARK'});
134 my %dns_servers = ();
138 # Read-in configfile.
139 &General
::readhasharray
($servers_file, \
%dns_servers);
141 # Check if we should edit an existing entry and got an ID.
142 if (($cgiparams{'SERVERS'} eq $Lang::tr
{'update'}) && ($cgiparams{'ID'})) {
143 # Assin the provided id.
144 $id = $cgiparams{'ID'};
146 # Undef the given ID.
147 undef($cgiparams{'ID'});
149 # Grab the configured status of the corresponding entry.
150 $status = $dns_servers{$id}[2];
152 # Each newly added entry automatically should be enabled.
155 # Generate the ID for the new entry.
157 # Sort the keys by their ID and store them in an array.
158 my @keys = sort { $a <=> $b } keys %dns_servers;
160 # Reverse the key array.
161 my @reversed = reverse(@keys);
163 # Obtain the last used id.
164 my $last_id = @reversed[0];
166 # Increase the last id by one and use it as id for the new entry.
169 # The first allowed id is 3 to keep space for
170 # possible ISP assigned DNS servers.
176 # Add/Modify the entry to/in the dns_servers hash.
177 $dns_servers{$id} = ["$cgiparams{'NAMESERVER'}", "$cgiparams{'TLS_HOSTNAME'}", "$status", "$cgiparams{'REMARK'}"];
179 # Write the changed hash to the config file.
180 &General
::writehasharray
($servers_file, \
%dns_servers);
182 # Call function to handle unbound restart, etc.
183 &_handle_unbound_and_more
();
185 # Switch back to previous mode.
186 $cgiparams{'SERVERS'} = $cgiparams{'MODE'};
189 # Toggle enable / disable.
191 } elsif ($cgiparams{'SERVERS'} eq $Lang::tr
{'toggle enable disable'}) {
192 my %dns_servers = ();
194 # Only go further, if an ID has been passed.
195 if ($cgiparams{'ID'}) {
196 # Assign the given ID.
197 my $id = $cgiparams{'ID'};
199 # Undef the given ID.
200 undef($cgiparams{'ID'});
202 # Read-in configfile.
203 &General
::readhasharray
($servers_file, \
%dns_servers);
205 # Grab the configured status of the corresponding entry.
206 my $status = $dns_servers{$id}[2];
209 if ($status eq "disabled") {
212 $status = "disabled";
215 # Modify the status of the existing entry.
216 $dns_servers{$id} = ["$dns_servers{$id}[0]", "$dns_servers{$id}[1]", "$status", "$dns_servers{$id}[3]"];
218 # Write the changed hash back to the config file.
219 &General
::writehasharray
($servers_file, \
%dns_servers);
221 # Call function to handle unbound restart, etc.
222 &_handle_unbound_and_more
();
225 ## Remove entry from DNS servers list.
227 } elsif ($cgiparams{'SERVERS'} eq $Lang::tr
{'remove'}) {
228 my %dns_servers = ();
230 # Read-in configfile.
231 &General
::readhasharray
($servers_file, \
%dns_servers);
233 # Drop entry from the hash.
234 delete($dns_servers{$cgiparams{'ID'}});
236 # Undef the given ID.
237 undef($cgiparams{'ID'});
239 # Write the changed hash to the config file.
240 &General
::writehasharray
($servers_file, \
%dns_servers);
242 # Call function to handle unbound restart, etc.
243 &_handle_unbound_and_more
();
245 ## Handle request to check the servers.
247 } elsif ($cgiparams{'SERVERS'} eq $Lang::tr
{'dns check servers'}) {
251 # Hash to store the generic DNS settings.
254 # Read-in general DNS settings.
255 &General
::readhash
("$settings_file", \
%settings);
257 # Hash which contains the configured DNS servers.
258 my %dns_servers = ();
260 # Read-in config file.
261 &General
::readhasharray
("$servers_file", \
%dns_servers);
263 &Header
::openpage
($Lang::tr
{'dns'}, 1, '');
265 &Header
::openbigbox
('100%', 'left', '', $errormessage);
268 # Error messages layout.
271 &Header
::openbox
('100%', 'left', $Lang::tr
{'error messages'});
272 print "<class name='base'>$errormessage\n";
273 print " </class>\n";
277 # Handle if a nameserver should be added or edited.
278 if (($cgiparams{'SERVERS'} eq "$Lang::tr{'add'}") || ($cgiparams{'SERVERS'} eq "$Lang::tr{'edit'}")) {
279 # Display the sub page.
280 &show_add_edit_nameserver
();
283 &Header
::closebigbox
();
284 &Header
::closepage
();
286 # Finished here for the moment.
290 $cgiparams{'GENERAL'} = '';
291 $cgiparams{'SERVERS'} = '';
292 $cgiparams{'NAMESERVER'} = '';
293 $cgiparams{'TLS_HOSTNAME'} = '';
294 $cgiparams{'REMARK'} ='';
296 $checked{'USE_ISP_NAMESERVERS'}{'off'} = '';
297 $checked{'USE_ISP_NAMESERVERS'}{'on'} = '';
298 $checked{'USE_ISP_NAMESERVERS'}{$settings{'USE_ISP_NAMESERVERS'}} = "checked='checked'";
300 $checked{'ENABLE_SAFE_SEARCH'}{'off'} = '';
301 $checked{'ENABLE_SAFE_SEARCH'}{'on'} = '';
302 $checked{'ENABLE_SAFE_SEARCH'}{$settings{'ENABLE_SAFE_SEARCH'}} = "checked='checked'";
304 $selected{'PROTO'}{'UDP'} = '';
305 $selected{'PROTO'}{'TLS'} = '';
306 $selected{'PROTO'}{'TCP'} = '';
307 $selected{'PROTO'}{$settings{'PROTO'}} = "selected='selected'";
309 $selected{'QNAME_MIN'}{'standard'} = '';
310 $selected{'QNAME_MIN'}{'strict'} = '';
311 $selected{'QNAME_MIN'}{$settings{'QNAME_MIN'}} = "selected='selected'";
313 # Display nameserver and configuration sections.
315 &show_general_dns_configuration
();
317 &Header
::closebigbox
();
318 &Header
::closepage
();
321 # General DNS-Servers sektion.
323 sub show_general_dns_configuration
() {
324 &Header
::openbox
('100%', 'center', "$Lang::tr{'dns configuration'}");
327 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
331 $Lang::tr{'dns use isp assigned nameservers'}
335 <input type="checkbox" name="USE_ISP_NAMESERVERS" $checked{'USE_ISP_NAMESERVERS'}{'on'}>
347 $Lang::tr{'dns use protocol for dns queries'}
351 <select name="PROTO">
352 <option value="UDP" $selected{'PROTO'}{'UDP'}>UDP</option>
353 <option value="TLS" $selected{'PROTO'}{'TLS'}>TLS</option>
354 <option value="TCP" $selected{'PROTO'}{'TCP'}>TCP</option>
367 $Lang::tr{'dns enable safe-search'}
371 <input type="checkbox" name="ENABLE_SAFE_SEARCH" $checked{'ENABLE_SAFE_SEARCH'}{'on'}>
383 $Lang::tr{'dns mode for qname minimisation'}
387 <select name="QNAME_MIN">
388 <option value="standard" $selected{'QNAME_MIN'}{'standard'}>$Lang::tr{'standard'}</option>
389 <option value="strict" $selected{'QNAME_MIN'}{'strict'}>$Lang::tr{'strict'}</option>
395 <td colspan="2" align="right">
396 <input type="submit" name="GENERAL" value="$Lang::tr{'save'}">
407 # Section to display the configured and used DNS servers.
409 sub show_nameservers
() {
410 &Header
::openbox
('100%', 'center', "$Lang::tr{'dns title'}");
412 my $dns_status_string;
415 # Test if the DNS system is working.
417 # Simple send a request to unbound and check if it can resolve the
419 my $dns_status_ret = &check_nameserver
("127.0.0.1", "$dns_test_server", "UDP");
421 if ($dns_status_ret eq "2") {
422 $dns_status_string = "$Lang::tr{'working'}";
423 $dns_status_col = "${Header::colourgreen}";
425 $dns_status_string = "$Lang::tr{'broken'}";
426 $dns_status_col = "${Header::colourred}";
433 <strong>$Lang::tr{'status'}: </strong>
434 <strong><font color='$dns_status_col'>$dns_status_string</font></strong>
441 <table class="tbl" width='100%'>
444 <strong>$Lang::tr{'nameserver'}</strong>
448 <strong>$Lang::tr{'country'}</strong>
452 <strong>$Lang::tr{'rdns'}</strong>
456 <strong>$Lang::tr{'remark'}</strong>
459 # Check if the status should be displayed.
460 if ($check_servers) {
463 <strong>$Lang::tr{'status'}</strong>
471 <td align="center" colspan="3">
472 <strong>$Lang::tr{'action'}</strong>
478 # Check the usage of ISP assigned nameservers is enabled.
481 # Loop through the array which stores the files.
482 foreach my $file (@ISP_nameserver_files) {
483 # Grab the address of the nameserver.
484 my $address = &General
::grab_address_from_file
($file);
486 # Check if we got an address.
488 # Add the address to the hash of nameservers.
489 $dns_servers{$id} = [ "$address", "none",
490 ($settings{'USE_ISP_NAMESERVERS'} eq "on") ?
"enabled" : "disabled",
491 "$Lang::tr{'dns isp assigned nameserver'}" ];
493 # Increase id by one.
498 # Check some DNS servers have been configured. In this case
499 # the hash contains at least one key.
501 if (keys %dns_servers) {
502 # Sort the keys by their ID and store them in an array.
503 my @keys = sort { $a <=> $b } keys %dns_servers;
505 # Loop through all entries of the array/hash.
506 foreach my $id (@keys) {
507 # Inrease server_amount.
510 # Assign data array positions to some nice variable names.
511 my $nameserver = $dns_servers{$id}[0];
512 my $tls_hostname = $dns_servers{$id}[1];
513 my $enabled = $dns_servers{$id}[2];
514 my $remark = $dns_servers{$id}[3];
523 if ($server_amount % 2) {
524 $col="bgcolor='$color{'color22'}'"; }
526 $col="bgcolor='$color{'color20'}'";
529 if ($enabled eq 'enabled') {
530 $gif='on.gif'; $toggle='off'; $gdesc=$Lang::tr
{'click to disable'};
532 $gif='off.gif'; $toggle='on'; $gdesc=$Lang::tr
{'click to enable'};
540 # Only grab the status if the nameserver is enabled.
541 if (($check_servers) && ($enabled eq "enabled")) {
542 $status = &check_nameserver
("$nameserver", "ping.ipfire.org", "$settings{'PROTO'}", "$tls_hostname");
546 $status_short = "$Lang::tr{'disabled'}";
548 # DNSSEC Not supported
549 } elsif ($status eq 0) {
550 $status_short = "$Lang::tr{'broken'}";
551 $status_message = $Lang::tr
{'dnssec not supported'};
552 $status_colour = ${Header
::colourred
};
555 } elsif ($status eq 1) {
556 $status_short = "$Lang::tr{'not validating'}";
557 $status_message = $Lang::tr
{'dnssec aware'};
558 $status_colour = ${Header
::colourblack
};
561 } elsif ($status eq 2) {
562 $status_short = "$Lang::tr{'ok'}";
563 $status_message = $Lang::tr
{'dnssec validating'};
564 $status_colour = ${Header
::colourgreen
};
568 $status_short = "$Lang::tr{'error'}";
569 $status_message = $status;
570 $status_colour = ${Header
::colourred
};
573 # collect more information about name server (rDNS, GeoIP country code)
574 my $ccode = &GeoIP
::lookup
($nameserver);
575 my $flag_icon = &GeoIP
::get_flag_icon
($ccode);
579 # Only do the reverse lookup if the system is online.
580 if (&red_is_active
()) {
581 my $iaddr = inet_aton
($nameserver);
582 $rdns = gethostbyaddr($iaddr, AF_INET
);
585 if (!$rdns) { $rdns = $Lang::tr
{'lookup failed'}; }
587 # Mark ISP name servers as disabled
588 if ($id <= 2 && $enabled eq "disabled") {
589 $nameserver = "<del>$nameserver</del>";
594 <td align="center" $col>
598 <td align="center" $col>
599 <a href='country.cgi#$ccode'><img src="$flag_icon" border="0" alt="$ccode" title="$ccode" /></a>
602 <td align="center" $col>
606 <td align="center" $col>
611 # Display server status if requested.
612 if ($check_servers) {
614 <td align="center" $col>
615 <strong><font color="$status_colour"><abbr title="$status_message">$status_short</abbr></font></strong>
621 # Check if the id is greater than "2".
623 # Nameservers with an ID's of one or two are ISP assigned,
624 # and we cannot perform any actions on them, so hide the tools for
629 <td align='center' width='5%' $col>
630 <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
631 <input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' title='$gdesc' alt='$gdesc' />
632 <input type='hidden' name='ID' value='$id' />
633 <input type='hidden' name='ENABLE' value='$toggle' />
634 <input type='hidden' name='SERVERS' value='$Lang::tr{'toggle enable disable'}' />
638 <td align='center' width='5%' $col>
639 <form method='post' name='frmb$id' action='$ENV{'SCRIPT_NAME'}'>
640 <input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' title='$Lang::tr{'edit'}' alt='$Lang::tr{'edit'}' />
641 <input type='hidden' name='ID' value='$id' />
642 <input type='hidden' name='SERVERS' value='$Lang::tr{'edit'}' />
646 <td align='center' width='5%' $col>
647 <form method='post' name='frmc$id' action='$ENV{'SCRIPT_NAME'}'>
648 <input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' title='$Lang::tr{'remove'}' alt='$Lang::tr{'remove'}' />
649 <input type='hidden' name='ID' value='$id' />
650 <input type='hidden' name='SERVERS' value='$Lang::tr{'remove'}' />
656 print "<td colspan='3' $col> </td>\n";
666 print"<table width='100%'>\n";
668 # Check if the usage of the ISP nameservers is enabled and there are more than 2 servers.
669 if (($settings{'USE_ISP_NAMESERVERS'} eq "on") && ($server_amount gt "2")) {
672 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
673 <td> <img src='/images/on.gif' alt='$Lang::tr{'click to disable'}' /></td>
674 <td class='base'>$Lang::tr{'click to disable'}</td>
675 <td> <img src='/images/off.gif' alt='$Lang::tr{'click to enable'}' /></td>
676 <td class='base'>$Lang::tr{'click to enable'}</td>
677 <td> <img src='/images/edit.gif' alt='$Lang::tr{'edit'}' /></td>
678 <td class='base'>$Lang::tr{'edit'}</td>
679 <td> <img src='/images/delete.gif' alt='$Lang::tr{'remove'}' /></td>
680 <td class='base'>$Lang::tr{'remove'}</td>
687 <form method="post" action="$ENV{'SCRIPT_NAME'}">
688 <td colspan="9" align="right">
689 <input type="submit" name="SERVERS" value="$Lang::tr{'add'}">
690 <input type="submit" name="SERVERS" value="$Lang::tr{'dns check servers'}">
702 <td colspan="6" align="center">
703 <br>$Lang::tr{'guardian no entries'}<br>
708 <form method="post" action="$ENV{'SCRIPT_NAME'}">
709 <td colspan="6" align="right"><input type="submit" name="SERVERS" value="$Lang::tr{'add'}"></td>
722 # Section to display the add or edit subpage.
724 sub show_add_edit_nameserver
() {
725 print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
727 my $buttontext = $Lang::tr
{'save'};
730 if ($cgiparams{'SERVERS'} eq $Lang::tr
{'edit'}) {
731 &Header
::openbox
('100%', 'left', $Lang::tr
{'dnsforward edit an entry'});
733 # Update button text for upate the existing entry.
734 $buttontext = $Lang::tr
{'update'};
736 # Add hidden input for sending ID.
737 print"<input type='hidden' name='ID' value='$cgiparams{'ID'}'>\n";
739 # Check if an ID has been given.
740 if ($cgiparams{'ID'}) {
741 # Assign cgiparams values.
742 $cgiparams{'NAMESERVER'} = $dns_servers{$cgiparams{'ID'}}[0];
743 $cgiparams{'TLS_HOSTNAME'} = $dns_servers{$cgiparams{'ID'}}[1];
744 $cgiparams{'REMARK'} = $dns_servers{$cgiparams{'ID'}}[3];
747 &Header
::openbox
('100%', 'left', $Lang::tr
{'dnsforward add a new entry'});
750 my $tls_required_image;
752 # If the protocol is TLS, dispaly the required image.
753 if ($settings{'PROTO'} eq "TLS") {
754 $tls_required_image = "<img src='/blob.gif' alt='*'>";
757 # Add hidden input to store the mode.
758 print "<input type='hidden' name='MODE' value='$cgiparams{'SERVERS'}'>\n";
763 <td width='20%' class='base'>$Lang::tr{'ip address'}: <img src='/blob.gif' alt='*' /></td>
764 <td><input type='text' name='NAMESERVER' value='$cgiparams{"NAMESERVER"}' size='24' /></td>
769 <td width='20%' class='base'>$Lang::tr{'dns tls hostname'}: $tls_required_image</td>
770 <td><input type='text' name='TLS_HOSTNAME' value='$cgiparams{'TLS_HOSTNAME'}' size='24'></td>
775 <td width ='20%' class='base'>$Lang::tr{'remark'}:</td>
776 <td><input type='text' name='REMARK' value='$cgiparams{'REMARK'}' size='40' maxlength='50' /></td>
785 <td class='base' width='55%'><img src='/blob.gif' alt ='*' align='top' /> $Lang::tr{'required field'}</td>
786 <td width='40%' align='right'>
787 <input type="submit" name="SERVERS" value="$buttontext">
788 <input type="submit" name="SERVERS" value="$Lang::tr{'back'}">
801 # Private function to handle the restart of unbound and more.
802 sub _handle_unbound_and_more
() {
804 system('/usr/local/bin/unboundctrl restart >/dev/null');
806 # Check if the IDS is running.
807 if(&IDS
::ids_is_running
()) {
808 # Re-generate the file which contains the DNS Server
810 &IDS
::generate_dns_servers_file
();
812 # Call suricatactrl to perform a reload.
813 &IDS
::call_suricatactrl
("restart");
817 # Check if the system is online (RED is connected).
818 sub red_is_active
() {
819 # Check if the "active" file is present.
820 if ( -f
"${General::swroot}/red/active") {
824 # Return nothing - False.
829 # Function to check a given nameserver against propper work.
830 sub check_nameserver
($$$$) {
831 my ($nameserver, $record, $proto, $tls_hostname) = @_;
833 # Check if the system is online.
834 unless (&red_is_active
()) {
835 return "$Lang::tr{'system is offline'}";
839 my @command = ("kdig", "+timeout=2", "+retry=0", "+dnssec",
842 # Handle different protols.
843 if ($proto eq "TCP") {
844 # Add TCP switch to the command.
845 push(@command, "+tcp");
847 } elsif($proto eq "TLS") {
848 # Add TLS switch to the command and provide the
849 # path to our file which contains the ca certs.
850 push(@command, "+tls-ca=$ca_certs_file");
852 # Check if a TLS hostname has been provided.
854 # Add TLS hostname to the command.
855 push(@command, "+tls-hostname=$tls_hostname");
857 return "$Lang::tr{'dns no tls hostname given'}";
861 # Add record to the command array.
862 push(@command, "$record");
864 # Add nameserver to the command array.
865 push(@command, "\@$nameserver");
867 # Connect to STDOUT and STDERR.
868 push(@command, "2>&1");
870 my @output = qx(@command);
871 my $output = join("", @output);
875 if ($output =~ m/status: (\w+)/) {
876 $status = ($1 eq "NOERROR");
884 while ($output =~ m/WARNING: (.*)/g) {
885 # Add the current grabbed warning to the warning string.
889 # Return the warning string, if we grabbed at least one.
896 if ($output =~ m/Flags: (.*);/) {
897 @flags = split(/ /, $1);
900 my $aware = ($output =~ m/RRSIG/);
901 my $validating = (grep(/ad;/, @flags));
903 return $aware + $validating;