473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

php exec and nslookup

111 100+
Hi I have been trying to use the php exec and nslookup for DNS lookups on a windows platform.

but whenever i execute the code i get the following error:
Unable to fork [nslookup -type=MX yahoo.com]

I am pretty sure that the code i'm using is ok.

I've come across a few sites that have said that the most probably answer is to set read + execute permissions on the exe.
I have no idea what this is or how to do this, any ideas?

also, is there a setting in the php.ini that i may need to edit.


the code that i'm using for the exec() is
[PHP]function customCheckDnsrr($host,$recType='') {
if(!empty($host)) {
if($recType=='')
$recType="MX";
exec("nslookup -type=$recType $host",$output);
foreach($output as $line) {
if(preg_match("/^$host/", $line)) {
return true;
}
}
return false;
}
return false;
}[/PHP]

where for testing i'm using $host as yahoo.com, as the input parameter.
Jan 9 '08 #1
1 5311
nitinpatel1117
111 100+
does anyone know how to fix this,, or guide me in the right direction
Jan 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: TomT | last post by:
Hi, I've been searching but have not been able to find a script that will allow nslookup's using ASP. I'm looking to use a form, that will allow users to enter IP addresses or domian names,...
6
by: axxegfx | last post by:
I need to resolve one domain , i have proved this: System.Net.Dns.GetHostByName("digitalprologic.com") but it returns an error. I have typed DOS nslookup -querytype=any digitalprologic.com...
0
by: ginn via DotNetMonster.com | last post by:
Hi, To block spam-mails I want to write my own blackhole list server for my Postfix mailserver in .NET In postfix i would have to add the line reject_rbl_client <myBlackList> to the...
1
by: kcw3388 | last post by:
Hi, I have a SunOS TCP/IP client program worked fine for a long time until yesterday. Now, my TCP/IP server program is located on different DNS server. The gethostbyaddr ( ) is now...
1
by: Franco Figún | last post by:
Hi everyone I need to simulate NSLOOKUP but with asp.net in c# o vb.net, any idea? I don't need a very complex example, only 2 textbox for the domain and other for the DNS server, and one button,...
0
by: pmclinn | last post by:
I'm looking to find the code to do an nslookup via my own dns like this: MyDNS = xxx.xxx.xxx.xxx result = resolve this ip(yyy.yyy.yyy.yyy) via this server MyDNS I have seen many examples...
2
by: Stuart Duncan | last post by:
Hi I am trying to put a web page together that will allow the user to find the MX record for a domain. I have found PHP code that uses nslookup but when I use it, I receive a "Page cannot be...
7
usafshah
by: usafshah | last post by:
When i try nslookup from my domain (either from domaincontroller or from any client) it says C:\Users\usaf.EITS>nslookup Default Server: UnKnown Address: 192.168.0.100:53 why UNKNOWN ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.