113 
Step Command  Remarks 
4.  Specify a DNS server 
IPv4 address in 
interface view. 
a  Enter interface view: 
interface interface-type 
interface-number 
b  Specify a DNS server IPv4 address: 
dns server ip-address [ vpn-instance 
vpn-instance-name ] 
By default, no DNS server 
address is specified. 
5.  Specify a DNS server 
IPv6 address. 
ipv6 dns server 
ipv6-address 
[ interface-type interface-number ] 
[ 
vpn-instance
 vpn-instance-name ]
 
 
Configuring DNS spoofing 
DNS spoofing is effective only when: 
•  The DNS proxy is enabled on the device. 
•  No DNS server or route to any DNS server is specified on the device. 
Follow these guidelines when you configure DNS spoofing: 
•  You can configure only one replied IPv4 address and one replied IPv6 address for the public 
network or a VPN instance. If you use the command multiple times, the most recent 
configuration takes effect. 
•  You can configure DNS spoofing for both public network and VPN instances. 
•  After DNS spoofing takes effect, the device spoofs a DNS request even though a matching 
static DNS entry exists. 
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, DNS spoofing is 
disabled. 
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: