in reply to Not so cool name resolution

You should not assume that every hostname starting with a number is an IP address. If you're going to do a regexp, why not go all the way: /^\d+(\.\d+){3}$/

It's also common practice to examine the last part of the domain, since this must be alphabetic for hostnames: /\.\d+$/ Don't just do /\d$/, because "www3" is a valid hostname, though "www.3" is not.