The dns server bind interface command sets the IP address of the DNS server bound to the interface.
The undo dns server bind interface command deletes the IP address of the DNS server bound to the interface.
dns server bind interface interface-type interface-number preferred preferred-dns-address [ alternate alternate-dns-address ] [ healthchk { enable [ times times | tx-interval tx-interval ] * | disable } ]
undo dns server bind interface interface-type interface-number [ preferred | alternate ]
| Parameter | Description | Value |
|---|---|---|
| interface-type interface-number | Specifies the interface type and number.
NOTE:
The interface can be bound only to the root system, not to virtual systems. |
- |
| preferred-dns-address | Specifies the IP address of the preferred DNS server. |
It is in dotted decimal notation. |
| alternate-dns-address | Specifies the IP address of the alternate DNS server. |
It is in dotted decimal notation. |
| enable | Enables health check on the interface. |
- |
| times | Specifies the maximum number of consecutive probe failures for health check. |
The value is an integer ranging from 2 to 10. The default value is 3. |
| tx-interval | Specifies the interval between sending probe packets. |
The value is an integer ranging from 3 to 10, in seconds. By default, it is 5 seconds. |
| disable | Disables health check on the interface. |
- |
If the outbound interface is bound to the IP addresses of both the preferred and alternate DNS servers, DNS transparent proxy will replace the destination address of the DNS query message with the IP address of the preferred DNS server and then forwards the packet. If the preferred DNS server is down, DNS transparent proxy will replace the destination address of the DNS query message with the IP address of the alternate DNS server.
If you delete the bound IP address of the preferred DNS server, the alternate DNS server automatically becomes the preferred DNS server.
# Set the IP address of the DNS server bound to interface GigabitEthernet 0/0/1. In the example, the IP address of the preferred DNS server is 10.2.0.70, and that of the alternate DNS server is 10.2.0.71.
<sysname> system-view
[sysname] dns-transparent-policy
[sysname-policy-dns] dns server bind interface GigabitEthernet 0/0/1 preferred 10.2.0.70 alternate 10.2.0.71