Added optimization for hostname resolvation