VpnService.Builder.AddDnsServer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AddDnsServer(InetAddress) |
Add a DNS server to the VPN connection. |
| AddDnsServer(String) |
Convenience method to add a DNS server to the VPN connection using a numeric address string. |
AddDnsServer(InetAddress)
Add a DNS server to the VPN connection.
[Android.Runtime.Register("addDnsServer", "(Ljava/net/InetAddress;)Landroid/net/VpnService$Builder;", "GetAddDnsServer_Ljava_net_InetAddress_Handler")]
public virtual Android.Net.VpnService.Builder AddDnsServer(Java.Net.InetAddress address);
[<Android.Runtime.Register("addDnsServer", "(Ljava/net/InetAddress;)Landroid/net/VpnService$Builder;", "GetAddDnsServer_Ljava_net_InetAddress_Handler")>]
abstract member AddDnsServer : Java.Net.InetAddress -> Android.Net.VpnService.Builder
override this.AddDnsServer : Java.Net.InetAddress -> Android.Net.VpnService.Builder
Parameters
- address
- InetAddress
The DNS server's IPv4 or IPv6 address.
Returns
This VPN builder with the DNS server added.
- Attributes
Exceptions
if the address is invalid.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Java documentation for android.net.VpnService.Builder.addDnsServer(java.net.InetAddress).
Applies to
AddDnsServer(String)
Convenience method to add a DNS server to the VPN connection using a numeric address string.
[Android.Runtime.Register("addDnsServer", "(Ljava/lang/String;)Landroid/net/VpnService$Builder;", "GetAddDnsServer_Ljava_lang_String_Handler")]
public virtual Android.Net.VpnService.Builder AddDnsServer(string address);
[<Android.Runtime.Register("addDnsServer", "(Ljava/lang/String;)Landroid/net/VpnService$Builder;", "GetAddDnsServer_Ljava_lang_String_Handler")>]
abstract member AddDnsServer : string -> Android.Net.VpnService.Builder
override this.AddDnsServer : string -> Android.Net.VpnService.Builder
Parameters
- address
- String
The DNS server's IPv4 or IPv6 address in numeric string form.
Returns
This VPN builder with the DNS server added.
- Attributes
Exceptions
if the address is invalid.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Java documentation for android.net.VpnService.Builder.addDnsServer(java.lang.String).