1

So anyways, I'm working on a small PHP website/script, and as one of the features I'd like to be able to run a WHOIS lookup on the current domain the PHP script is running on. I don't know much about WHOIS lookups (well, I know what they do, I just don't know how to run them in PHP) Please let me know how to do it and get same result as : http://www.ipfingerprints.com/whois.php.

Yassin Sterno
  • 41
  • 2
  • 4

1 Answers1

-1

If you are on Linux, you can simply call exec() with the Linux whois command.
http://linux.about.com/library/cmd/blcmdl1_whois.htm
http://www.php.net/manual/en/function.exec.php
If not, I'm sure there is a Windows cmdline alternative for whois.

bryanph
  • 993
  • 7
  • 18
  • No, this is the worse advice to give! Do not escape to the shell from PHP just to start a whois command, as this will create a bunch of security and performance problems. PHP has libraries to do whois queries so use them inside your language or if you prefer a low level just open a TCP socket to port 43 and read RFC3912 for the whois protocol specification. – Patrick Mevzek Jan 03 '18 at 20:17