The dns server vpn-instance command configures the device to send DNS query requests to the DNS server on a specified VPN network.
The undo dns server vpn-instance command disables the device from sending DNS query requests to the DNS server on a specified VPN network.
By default, the device can only send DNS query requests to the DNS server on a public network.
| Parameter | Description | Value |
|---|---|---|
vpn-instance-name |
Specifies a VPN instance name. |
It must be the name of an existing VPN instance. |
If an interface on the device and the DNS server have reachable routes to each other and the interface is on a VPN network, the device must use the DNS server on the VPN network for DNS query so that DNS packets can be exchanged properly.
If you run this command multiple times, only the latest configuration takes effect.
The device can send DNS query requests to the DNS server on a public network or specified VPN network.
After a VPN instance is bound to the interface connected to the DNS client, the DNS proxy or relay function does not take effect.
# Configure the device to send DNS query requests to the DNS server on the VPN network vpn1.
<sysname> system-view [sysname] ip vpn-instance vpn1 [sysname-vpn-instance-vpn1] ipv4-family [sysname-vpn-instance-vpn1-af-ipv4] quit [sysname-vpn-instance-vpn1] quit [sysname] dns server vpn-instance vpn1