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

@orrabin can you please write a few lines describing the mixin and its usage?