Operating System - Linux
1748137 Members
3632 Online
108758 Solutions
New Discussion юеВ

Re: To execute nslookup -type=mx in Perl script

 
Arun Kumar Rajamari
Frequent Advisor

To execute nslookup -type=mx in Perl script

Hi,

To execute the command nslookup to find the MX record for a domain in Perl script,for eg

"nslookup -type=mx google.com"

But this should be implemented without using Net::DNS module.

The command should go something like,
----------------------------------------------
$code = Win32::OLECreateObject('Dynu.Exec',$oExec) or die "Couldn't create new oExec Object!";
print $oExec->Execute('nslookup -type=mx microsoft.com');
$oExec->Quit();
----------------------------------------------

What are the modules needed for the above Perl lines apart from
Use OLE;


Please help me in this regards,

Arun
3 REPLIES 3
Ralph Grothe
Honored Contributor

Re: To execute nslookup -type=mx in Perl script

In your first thread in this nslookup matter
you didn't mention you wanted this implemented on a Windows box.
Maybe you should better move your thread to the Microsoft forum of ITRC to find someone who has experience with Win32::OLE objects?
Madness, thy name is system administration
Arun Kumar Rajamari
Frequent Advisor

Re: To execute nslookup -type=mx in Perl script

Hi,

Thanks for your reply.
I thought that win32 & OLE would work in Unix box,the script has to be implemented in Unix Box.

So in relation with my other thread,I would like to find the way to implement without Net::DNS module.

Thanks,
Arun
Ralph Grothe
Honored Contributor

Re: To execute nslookup -type=mx in Perl script

I may be wrong beacause I'm not into Windows.
But as far as I thought to have known Win32::OLE is a perl API for accessing OLE applications.
I thought OLE was a technique developed an promoted by Microsoft, and inherent to their applications like Office suite programs etc.
Therefore I would assume that Win32::OLE was only installable on Windows ports of Perl like e.g. that of ActiveState.
The Win32 namespace also conveys this to me.
But as said, I don't know anything about Microssoft products.
Maybe these will help in clarifying prerequisites?

http://en.wikipedia.org/wiki/Object_Linking_and_Embedding
http://search.cpan.org/~jdb/libwin32-0.26/OLE/lib/Win32/OLE.pm
Madness, thy name is system administration