DnsCache.lookup

IpAddress[] lookup(scope const(char)[] hostname) @trusted

Look up a hostname in the cache.

Returns cached addresses for valid (non-expired) positive entries. Expired entries are pruned. Negative entries return an empty array with the stored error code accessible via lookupError.

Parameters

hostnameHostname to look up.

Returns

Cached IP addresses, or an empty array when not cached or expired.