http://www.perlmonks.org?node_id=1079871


in reply to query dns by hostname

I think you are misunderstanding what gethostbyname() does. gethostbyname allows you to resolve a DNS (or /etc/hosts entry) to an IP address. It does not allow you to do wildcard searches on a partial domain name.