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

@ohadlevy I hope now it is clearer