automated localhost detection