The dns server source-interface command configures the IP address of a specified interface as the source IP address of the DNS query messages sent by a device to the DNS server.
The undo dns server source-interface command restores the default setting.
By default, the source interface IP address is used as the source IP address of the DNS query messages sent by a device to the DNS server.
Parameter |
Description |
Value |
|---|---|---|
interface-type interface-number |
Specifies the type and number of an interface. |
– |
When a device sends DNS query messages to the DNS server through interface A, the IP address of interface A is used as the source IP address of the DNS query messages by default. If the DNS server only has routes destined for the IP address of interface B and does not have routes destined for the IP address of interface A, you need to set the source IP address of the DNS query messages to the IP address of interface B; otherwise, the DNS server may fail to return response packets due to a route query failure.
This function is supported only if the device performs a DNS query through the DNS server with an IPv4 address and is not supported if the device performs a DNS query through the DNS server with an IPv6 address.