ResolutionGuardedDns

class ResolutionGuardedDns(delegate: Dns = Dns.SYSTEM) : Dns

OkHttp Dns that refuses to hand out any address ResolutionNetworkGuard disallows.

The pre-flight host check runs before the request; this wrapper re-checks the addresses OkHttp will actually connect to, so a DNS answer that changes between the check and the connection (DNS rebinding) cannot reach an internal address.

Constructors

Link copied to clipboard
constructor(delegate: Dns = Dns.SYSTEM)

Functions

Link copied to clipboard
open override fun lookup(hostname: String): List<InetAddress>