--- loncom/lonnet/perl/lonnet.pm 2011/05/13 02:26:21 1.1106 +++ loncom/lonnet/perl/lonnet.pm 2011/05/14 15:47:04 1.1107 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1106 2011/05/13 02:26:21 raeburn Exp $ +# $Id: lonnet.pm,v 1.1107 2011/05/14 15:47:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -10084,13 +10084,19 @@ sub get_dns { my $loaded; my %name_to_host; my %internetdom; + my %LC_dns_serv; sub parse_hosts_tab { my ($file) = @_; foreach my $configline (@$file) { next if ($configline =~ /^(\#|\s*$ )/x); - next if ($configline =~ /^\^/); - chomp($configline); + chomp($configline); + if ($configline =~ /^\^/) { + if ($configline =~ /^\^([\w.\-]+)/) { + $LC_dns_serv{$1} = 1; + } + next; + } my ($id,$domain,$role,$name,$protocol,$intdom)=split(/:/,$configline); $name=~s/\s//g; if ($id && $domain && $role && $name) { @@ -10226,6 +10232,14 @@ sub get_dns { my ($lonid) = @_; return $internetdom{$lonid}; } + + sub is_LC_dns { + &load_hosts_tab() if (!$loaded); + + my ($hostname) = @_; + return exists($LC_dns_serv{$hostname}); + } + } {