Get the DNS address of a host by using inet_ntoa and inet_aton : DNS « Network « Perl






Get the DNS address of a host by using inet_ntoa and inet_aton

    

use Socket;

$site_name = 'www.cpan.org';

$address = inet_ntoa(inet_aton($site_name));

print "The DNS address of www.cpan.org is $address";

   
    
    
    
  








Related examples in the same category