Also watch for a trailing dot in the hostname. Its technically valid and will give you a blank string as the first item in the list.