Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Function to perform the nslookup query
- function nslookup($domain, $nameserver) {
- $cmd = "nslookup -querytype=A $domain $nameserver";
- $output = shell_exec($cmd);
- return $output;
- }
- // List of domains and nameservers
- $domains_nameservers = array(
- array('domain' => 'example1.com', 'nameserver' => '8.8.8.8'),
- array('domain' => 'example2.com', 'nameserver' => '8.8.4.4'),
- array('domain' => 'example3.com', 'nameserver' => '208.67.222.222'),
- );
- // Loop through the domains and nameservers
- foreach ($domains_nameservers as $data) {
- $domain = $data['domain'];
- $nameserver = $data['nameserver'];
- // Perform the nslookup query
- $result = nslookup($domain, $nameserver);
- // Print the result
- echo "Domain: $domain | Nameserver: $nameserver\n";
- echo nl2br($result);
- echo "\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement