Take a look at http://rallenhome.com/books/dnsonw2k3/toc.html

I found a VBScript that did something very close to what you're trying to do.  
The differences are/could be:

- queries needed to be directed to a domain controller
- queries were only successful in the same domain [i.e., asking about 
fabrikam.com A records inside the fabrikam.com domain]

' Perform an SRV record query

' ---------------------------------------------------------------
' From the book "DNS on Windows Server 2003"
' By Cricket Liu, Matt Larson & Robbie Allen
' Publisher: O'Reilly and Associates
' ISBN: 0-596-00562-8
' Book web site: http://rallenhome.com/books/dnsonw2k3/toc.html
' ---------------------------------------------------------------

Unfortunately, the site that used to host the code appears to be no longer 
hosts it.  I found in google.com's cache and in bing.com's cache...

http://cc.bingj.com/cache.aspx?q=perform+an+srv+query&d=76844041126311&mkt=en-US&setlang=en-US&w=1f6e49b4,a90da8c2


-----Original Message-----
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of rocku
Sent: Tuesday, October 20, 2009 10:35 AM
To: perl-win32-users@listserv.activestate.com
Subject: Resolve hostname by specified nameserver

Hello,
I need to resolve a hostname by a specified nameserver. Currently I am 
using nslookup throught backticks, but it's output differs slightly 
between Windows versions and is hard to parse. I wanted to use Socket 
and something like inet_ntoa(inet_aton('hostname')) but this way I have 
no option to specify the nameserver to query. I am aware about Net::DNS, 
but unfortunately I cannot use it because it's not standard in 
ActivePerl 5.10. An ideal solution would be some WMI function, but I 
cannot find any for the task. Maybe using Win32::API?

So my question is - how to query a specific nameserver about a DNS 'A' 
record?

-- 
rocku
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to