DnsCache.storeNegative

void storeNegative(scope const(char)[] hostname, uint ttlSeconds = 0, DnsError error = DnsError.NONAME) @trusted

Store a negative (error) result in the cache.

Prevents repeated lookups for hostnames that do not exist or are experiencing non-recoverable errors.

Parameters

hostnameHostname that failed to resolve.
ttlSecondsNegative cache TTL. Uses negativeTtl from config when zero.
errorThe DNS error code. Defaults to NONAME.