> I have been looking for a utility that will let
> me query WINS servers the way NSLOOKUP queries
> DNS servers. I haven't found anything yet so I
> thought there might be a way to script the
> query using perl.
My Net::NBName module sounds like it will do what
you want. It allows you to send name queries
to windows hosts such as WINS servers. It comes
with an example script that will allow you to do just that:
use strict;
use Net::NBName;
my $nb = Net::NBName->new;
my $param = shift;
my $host = shift;
if ($param =~ /^(\w+)\#(\w{1,2})$/) {
my $name = $1;
my $suffix = hex $2;
my $nq;
if (defined($host) && $host =~ /\d+\.\d+\.\d+\.\d+/) {
printf "querying %s for %s<%02X>...\n", $host, $name, $suffix;
$nq = $nb->name_query($host, $name, $suffix);
} else {
printf "broadcasting for %s<%02X>...\n", $name, $suffix;
$nq = $nb->name_query(undef, $name, $suffix);
}
if ($nq) {
print $nq->as_string;
}
} else {
die "expected: <name>#<suffix> [<host>]\n";
}
You can get the module from CPAN, or if you
are using PPM, from my repository at:
http://www.goodweather.co.uk/perl/packages
> I looked through the documentation I have and
> I cannot find anything that tells how to send
> a query to a WINS server. Can anyone on the
> list point me at either the commands or some
> examples that would help me?
> Background: We don't run the WINS servers
> where I work and I think they are broken. The
> only way I can track responses from WINS is
> indirectly and I am having trouble getting the
> people who run WINS to pay any attention. I
> need something that shows what each WINS
> server is sending out
Be nice to your WINS administrators :-) I'm one.
James
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs