Specifying the source interface for DNS packets

About the source interface for DNS packets

This task enables the device to always use the primary IP address of the specified source interface as the source IP address of outgoing DNS packets. This feature applies to scenarios in which the DNS server responds only to DNS requests sourced from a specific IP address. If no IP address is configured on the source interface, no DNS packets can be sent out.

Restrictions and guidelines

When sending an IPv6 DNS request, the device follows the method defined in RFC 3484 to select an IPv6 address of the source interface.

You can configure only one source interface on the public network or a VPN instance. You can configure source interfaces for both public network and VPN instances.

Make sure the source interface belongs to the specified VPN instance if you specify the vpn-instance vpn-instance-name option.

Procedure

  1. Enter system view.

    system-view

  2. Specify the source interface for DNS packets.

    dns source-interface interface-type interface-number [ vpn-instance vpn-instance-name ]

    By default, no source interface for DNS packets is specified.