HADOOP-7499. Add method for doing a sanity check on hostnames in NetUtils. (Jeffrey Naisbit via mahadev)