< Home

dns-server-select-algorithm

Function

The dns-server-select-algorithm command configures the DNS server selection mode of the device.

The undo dns-server-select-algorithm command restores the default setting.

By default, the device selects a DNS server in auto mode.

Format

dns-server-select-algorithm { fixed | auto }

undo dns-server-select-algorithm

Parameters

Parameter

Description

Value

fixed

Selects a DNS server in fixed mode.

-

auto

Selects a DNS server in auto mode.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

The device can select a DNS server in either of the following modes:
  • auto: The device uses the internal algorithm to calculate the priorities of all configured DNS servers (IP addresses of DNS servers can be configured by running the dns server command), and then sends a DNS query request to the DNS server with the highest priority. If no response is received within a specified period of time, the device retransmits the DNS query request. If the device still does not receive a response from the DNS server after sending query requests multiple times, the device sends the DNS query request to the next server in sequence until it receives a response or has sent to all of the configured DNS servers.
  • fixed: The device sends a DNS query request to the first DNS server. If no response is received within a specified period of time, the device retransmits the DNS query request. If the device still does not receive a response from the DNS server after sending query requests multiple times, the device sends the DNS query request to the next server in sequence until it receives a response or has sent to all of the configured DNS servers.

This function is supported when the device functions as a DNS client or DNS proxy/relay.

When the device functions as a DNS client:
  • This function is supported only for DNS query requests sent by IPSec, voice, PKI, or DDNS services.

  • The DNS server selection mode is not supported for DNS query requests sent by other services. The device sends the requests according to the order in which DNS servers are configured. If no response is received, the device retransmits the requests according to the order in which DNS servers are configured.

Example

# Configure the device to select a DNS server in fixed mode.

<sysname> system-view
[sysname] dns-server-select-algorithm fixed
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >