Fixed the domain creation code for domains without an extension

For local development i'm using a lot of domains without extension. This fixes a bug that is caused when you have a domain without an extension.