This looks like a dupe of Excluded Sub Domains which is a little older, has a few more votes and even offered up some code to implement this.
This looks like a dupe of Excluded Sub Domains which is a little older, has a few more votes and even offered up some code to implement this.