Fixes #7164: Cannot create a domain that starts or ends with '.'

best is to provide an actual code snippet, an exmaple https://github.com/rails/rails/blob/master/activesupport/lib/active_support/hash_with_indifferent_access.rb#L4