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

@ohadlevy is this enough of an explanation?