This is a simple online API for checking if a hostname is valid. Implementation is just a thin wrapper around InternetDomainName from Google's Guava library.
See the HTML source for details on how to call it.