in reply to Handling output from nslookup and ping
And Net::DNS.
If all he needs is to resolve "hostname", gethostbyname() should work, comes with Perl, and may be faster.