Nameserver lookup
| From: | Hans J.J. Prins | Date: | Tue, 07 Jun 2005 12:51:10 +0000 |
| Subject: | Nameserver lookup | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-216548@lists.php.net to get a copy of this message | ||
Hello,
I seem to be having a little bit of trouble with executing a nslookup via
PHP's passthr() function.
This:
passthru("nslookup -query=ns testing12345.nl", $returnVar);
Returns:
"Server: ns1.activedomain.nl
Address: 217.148.161.5
Aliases: 5.161.148.217.in-addr.arpa
0"
However, when I execute the nslookup command directly from my SSH client, I
get this result (minus the ---):
---
Server: ns1.activedomain.nl
Address: 217.148.161.5
Aliases: 5.161.148.217.in-addr.arpa
*** ns1.activedomain.nl can't find testing12345.nl: Non-existent host/domain
---
For some reason passthru does not pass back the last line. And that is
exactly the line that I need! I also tried exec(), system() and shell_exec()
But PHP does not give me that last line.
I should mention that I'm on a freeBSD system with Apache 1.3.32 and PHP
4.3.10
Can anyone help me out on this?
Thanks in advance.
Hans J.J. Prins