473,666 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php exec and nslookup

111 New Member
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 customCheckDnsr r($host,$recTyp e='') {
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 5349
nitinpatel1117
111 New Member
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
7301
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, then preform nslookup type of searches on the entered information. This is for a test server, so would like a free option if one is available.
6
8321
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 and it exists and a Whois web too. Help!!!
0
2496
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 smtp_client_restrictions and postfix would send a request, if this mail should be blocked, to my blacklist server. Since the Postifx server is already in use I can't use it to test my code. So I thought with nslookup I can simulate my Postfix-request.
1
4987
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 returned NULL instead.
1
3004
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, that's all. Any help? Thanks -- FF www.francofigun.com.ar
0
1225
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 that just default to the systems DNS but that's not what I'm looking for...
2
3227
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 displated" error. The URL in the address bar is the source folder of my initial form page with nslookup.php on the end. Can anyone tell me how to do this or what is wrong.
7
21065
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
8454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8645
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7389
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.