dns source-interface
Use dns source-interface to specify the source interface for DNS packets.
Use undo dns source-interface to restore the default.
Syntax
dns source-interface interface-type interface-number [ vpn-instance vpn-instance-name ]
undo dns source-interface interface-type interface-number [ vpn-instance vpn-instance-name ]
Default
No source interface for DNS packets is specified. The device uses the primary IP address of the output interface of the matching route as the source IP address for a DNS request.
Views
System view
Predefined user roles
network-admin
Parameters
interface-type interface-number: Specifies an interface by its type and number.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. To specify a source interface on the public network, do not use this option.
Usage guidelines
This configuration applies to both IPv4 and IPv6.
In IPv4 DNS, the device uses the primary IPv4 address of the specified source interface as the source IP address of DNS query.
In IPv6 DNS, the device follows the procedure defined in RFC 3484 to select an IPv6 address of the source interface as the source IP address for DNS query.
If you use the command multiple times, the most recent configuration takes effect.
You can specify the following:
Source interfaces for the public network and a maximum of 1024 VPNs.
Only one source interface for the public network or each VPN.
Make sure the specified interface is on the VPN specified by the vpn-instance vpn-instance-name option.
Examples
# Specify VLAN-interface 2 as the source interface for DNS packets on the public network.
<Sysname> system-view [Sysname] dns source-interface vlan-interface 2