Properly detect local host