O'Reilly logo

Win32 Perl Programming: The Standard Extensions, Second Edition by Dave Roth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Resolving DNS Names

Few things in life bring as much joy to a network administrator as being able to resolve DNS names to IP addresses. And, of course, Win32 Perl has many ways to resolve DNS names. You can use the Net::DNS module available from CPAN or Perl’s built-in DNS functions such as gethostbyname() and its brethren. Win32 Perl did not always have such rich DNS support (early versions did not support the built-in functions). Because of this, the Win32::AdminMisc module included a few functions that are still available:

Win32::AdminMisc::GetHostAddress( $DNS_Name ); 
Win32::AdminMisc::gethostbyname( $DNS_Name ); 
Win32::AdminMisc::GetHostName( $IP_Address ); 
Win32::AdminMisc::gethostbyaddr( $IP_Address ); 

These four functions all work ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required