Added private/public/localhost fallback for ip discovery.