avoid resolving same hostname multiple times, use first result and cache instead