102
To configure DNS spoofing:
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Enable DNS proxy.
dns proxy enable
By default, DNS proxy is disabled.
3.
Enable DNS
spoofing and
specify the IP
address used to
spoof DNS
requests.
•
Specify an IPv4 address:
dns spoofing
ip-address
[
vpn-instance
vpn-instance-name
]
•
Specify an IPv6 address:
ipv6 dns spoofing
ipv6-address
[
vpn-instance
vpn-instance-name
]
By default, no IP address is
specified for DNS spoofing.
You can specify both an IPv4
address and an IPv6 address.
Configuring network mode tracking for an output
interface
This feature tracks the network mode of an output interface and spoofs DNS requests if the network
mode is 2G. This feature takes effect on the cellular interface when the interface acts as the output
interface to reach the DNS server. Spoofing DNS requests avoids DNS packet loss that might be
caused by limited 2G network bandwidth.
To configure network mode tracking for an output interface:
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Enable DNS proxy.
dns proxy enable
By default, DNS proxy is disabled.
3.
Enable DNS spoofing and
specify the IP address
used to spoof DNS
requests.
•
Specify an IPv4 address:
dns spoofing
ip-address
[
vpn-instance
vpn-instance-name
]
•
Specify an IPv6 address:
ipv6 dns spoofing
ipv6-address
[
vpn-instance
vpn-instance-name
]
By default, no IP address is
specified for spoofing.
You can specify both an IPv4
address and an IPv6 address.
As a best practice, specify a
private IP address on the device.
4.
Configure the device to
track the network mode of
an output interface.
dns spoofing track controller
interface-type
interface-number
By default, the device does not
track the network mode of an
output interface.
Specifying 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.
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. You can configure the
source interface for the public network and a maximum of 1024 VPNs.
To specify the source interface for DNS packets: