Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does PHP have a built-in alternative to exec("nslookup")?

Tags:

shell

php

I have the following command in my PHP class:

@exec('nslookup -type=' . $type . ' ' . escapeshellcmd($host), $output);

This doesn't run on my server because of security restrictions (exec and escapeshellcmd are disabled from php.ini). Is there any alternative that doesn't rely on exec?

like image 401
Memphis Raines Avatar asked Feb 22 '23 15:02

Memphis Raines


1 Answers

You can use dns_get_record():

http://www.php.net/dns_get_record

like image 171
Cheery Avatar answered Feb 24 '23 14:02

Cheery