Jump to content

Net_DNS package help!


Katanius

Recommended Posts

I use the command line pear command to install the net_DNS package after i made sure i have all needed dependencies, i get installation successfull message, i copy paste the example from the pear.net documantation of Net_DNS to test if its working, i run the script and it returns nothing...

I run scripts localy on my comptuter on a windows platform with an Apatche server.

What did i do wrong? plz help me.

Link to comment
https://forums.phpfreaks.com/topic/54356-net_dns-package-help/
Share on other sites

the code i used is this:

<?php
require_once 'Net/DNS.php';

$resolver = new Net_DNS_Resolver();
$response = $resolver->query('example.com');
if ($response) {
  foreach ($response->answer as $rr) {
    $rr->display();
  }
}
?>

its straight from the documentation example, i also tryied this:

<?php

// include class file
include("Net/DNS.php");

// create object
$ndr = new Net_DNS_Resolver();

// uncomment this for debug output
// $ndr->debug = 1;

// query for IP address
$answer = $ndr->search("cnet.com", "A");

// print output
print_r($answer);

?>

also with no success.

 

this is my include path:

 

;include_path = "C:\PHP5\PEAR"

 

and this is my php instalation dir:

C:\PHP5

the package is installed in:

C:\PHP5\PEAR\Net

Link to comment
https://forums.phpfreaks.com/topic/54356-net_dns-package-help/#findComment-268812
Share on other sites

I changed the code to this enabeling debug output:

<?php

// include class file
require_once("Net\DNS.php");

// create object
$ndr = new Net_DNS_Resolver();
echo $ndr;

// uncomment this for debug output
$ndr->debug = 1;
echo $ndr;

// query for IP address
$answer = $ndr->search("google.com", "MX");
echo $ndr;

// print output
print_r($answer);


?>

 

and got this output:

 

Object id #1Object id #1;; search(google.com, MX, IN) ;; query(google.com, MX, IN) ;; using simple sockets Object id #1

 

What does this mean? does it mean the package works and im doing something wrong or it doent work an just outputs something?

I just cant seem to get it to work... and i really need it to work! do you know of anywhare i can get some help with this cause the documentation doesnt help much...

 

Link to comment
https://forums.phpfreaks.com/topic/54356-net_dns-package-help/#findComment-269070
Share on other sites

I also get the following errors:

 

Notice: Trying to get property of non-object in C:\Program Files\Apache Group\Apache2\htdocs\dns\dnsdig.php on line 9

 

Notice: Trying to get property of non-object in C:\Program Files\Apache Group\Apache2\htdocs\dns\dnsdig.php on line 9

 

I also get this from another script using the same package:

 

Fatal error: Call to a member function display() on a non-object in C:\Program Files\Apache Group\Apache2\htdocs\dns\dnsspec.php on line 13

Link to comment
https://forums.phpfreaks.com/topic/54356-net_dns-package-help/#findComment-270436
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.