VPN Node DNS Configuration
The SDK allows you to change the DNS server used by the VPN node to resolve DNS requests. You can configure either a predefined DNS server provided by the backend or specify a custom DNS server URL.
Option 1: Use Predefined DNS (From Backend API)
To use a predefined DNS server configured by the backend, follow these steps:
Fetch the available DNS server from the backend using
sdk.getBackend().locations
.Pass the DNS value to the
withNodeDns()
method.
getDnsServers()
: Retrieves the list of available DNS servers from the backend.withNodeDns(NodeDns.custom(dns))
: Configures the VPN node to use the DNS server retrieved from the backend.
Option 2: Use a Custom User-Defined DNS
Alternatively, you can define a custom DNS URL and pass it to the withNodeDns()
method:
NodeDns.user()
: Allows you to specify a user-defined DNS URL that will be used for DNS resolution on the VPN node.
Last updated