Check whether a string is a domain.