code: def validate_hostname(value)
        match_data = HOSTNAME_REGEXP.match(value)
        if match_data
          value.split('.').each_with_index do |label, i|
            unless label.length <= 63
              raise ValidationError,
                    "hostname's #{i.ordinalize} label '#{label}' is not less than 63 characters in '#{value}'"
            end
          end
        else
          raise ValidationError, "invalid hostname '#{value}'"
        end
      end
docs: Validate that the given string _value_ describes a well-formed
   host name as specified by RFC 1034.
   (see http://www.rfc-editor.org/rfc/rfc1034.txt)