Extension to ActiveRecord::Base for validating hostnames and domain names