3 # Call whois to get zone info
5 require './bind8-lib.pl';
7 $access{'whois'} || &error($text{'whois_ecannot'});
8 $zone = &get_zone_name($in{'index'}, $in{'view'});
9 $dom = $zone->{'name'};
10 $tv = $zone->{'type'};
12 &can_edit_zone($zone) ||
13 &error($text{'master_ecannot'});
14 $desc = &ip6int_to_net(&arpa_to_ip($dom));
15 &ui_print_header($desc, $text{'whois_title'}, "",
16 undef, undef, undef, undef, &restart_links($zone));
18 # Find the best whois server for the domain
19 foreach $wf ("$module_root_directory/whois-servers",
20 "$module_config_directory/whois-servers") {
24 local ($wdom, $wserv) = split(/\s+/);
25 $whois{$wdom} = $wserv;
29 foreach $d (sort { length($b) <=> length($a) } keys %whois) {
30 if ($dom =~ /\Q$d\E$/) {
31 $server = "-h ".quotemeta($whois{$d});
32 $pserver = "-h ".$whois{$d};
37 $qdom = quotemeta($dom);
38 $cmd = "$config{'whois_cmd'} $server $qdom";
39 $pcmd = "$config{'whois_cmd'} $pserver $dom";
41 if ($out =~ /whois\s+server:\s+(\S+)/i) {
42 $cmd = "$config{'whois_cmd'} -h ".quotemeta($1)." $qdom";
43 $pcmd = "$config{'whois_cmd'} -h $1 $dom";
46 print &ui_table_start(&text('whois_header', "<tt>".&html_escape($pcmd)."</tt>"),
48 print &ui_table_row(undef, "<pre>".&html_escape($out)."</pre>", 2);
49 print &ui_table_end();
51 &ui_print_footer(($tv eq "master" ? "edit_master.cgi" :
52 $tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
53 "?index=$in{'index'}&view=$in{'view'}", $text{'master_return'});