Log in

View Full Version : how to execute dnscmd command from php



SameerMirza
12-10-2009, 03:16 PM
Hi all,
I am trying to create and D NS entry from my web site (windows/php/iis). I have found the command dnscmd that can be used to create dns entry but I dont know how to execute it from php.
It will be great if some one could help me out with it.

Regards,
Sameer.

SameerMirza
12-11-2009, 12:03 PM
I have tried following,


<?php
$command = 'C:\DNSCMD\dnscmd.exe dns_server /zone aaakkkaaa2.lon A ip_address';
shell_exec("$command");
$output = shell_exec("$command");
echo(nl2br($output));
?>
but I am getting the following error message,
Command failed: ERROR_ACCESS_DENIED 5 (00000005)
Can any one think of a possible reason?
It will be great if some one could me out with it.
COMon goys some one should this.

Thanks,
SM.