Enhancement: Add support for hostnames (and more robust IP checking, too!)

This fully addresses #105.
It wouldn't block the pull request, but is is feasible to avoid using exceptions for control flow?

i.e.  If an exception occurs, it wouldn't lead to another positive case (in this case resolving a hostname).