utility methods for parsing domain names