We have 42 guests online
PHP Scripts arrow Free PHP Tutorials arrow Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP 
Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP

DNS
User Rating: / 21
PoorBest 

This is a simple PHP that dns's a selected host or ip.

  1. /*
  2. Example by b0lt
  3. This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
  4. Example Name: dns.php
  5. Tested On: PHP4  
  6. Notes: Example is to learn from i supose.
  7. */
  8.  
  9. <?php
  10.  
  11. ?>
  12.  
  13. <form method="POST" action="dns.php?info=lookitup">
  14. <p align="center">Hostname:     <input type="text" name="dval" size="26">
  15. <br><br>or<br>
  16. <p align="center">IP:     <input type="text" name="dval1" size="26">
  17. <br>
  18. <br>
  19. <input name="submit" type="submit" value="Submit">
  20. </form>
  21.  
  22. <?
  23.  
  24. if(isset($info)) {
  25.     if($info == "lookitup") {
  26.         if(!$dval1 && !$dval) {
  27.             echo "Error: You Left Both Forms Blank.";
  28.             return;
  29.         }
  30.         if(!$dval) {
  31.             $dlook1=gethostbyaddr($dvar1);
  32.             echo "$dval1 resolves (Reverse-DNS's) to $dlook1";
  33.             return;
  34.         }   
  35.     $dlook=gethostbyname($dval);
  36.     echo "$dval resolves (DNS's) to $dlook";
  37.     }
  38. }
  39. ?>

 

 

Directory Stats

There are 1019 listing and 46 categories in our website

Change Language