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