dynamically detect hosts