< Home

Configuring the Dynamic Domain Name Resolution

Context

For dynamic domain name resolution, the DNS server needs to provide the mapping between domain names and IP addresses and receive domain name resolution requests from clients.

To implement dynamic domain name resolution, you need to enable dynamic domain name resolution function, configure the IP address of DNS server, configure the source IP address of the DNS packets sent by the local device, and configure a domain name suffix.

If both the IPv4 DNS proxy or relay and IPv6 DNS proxy or relay functions are enabled on the device, both the IPv4 DNS server and IPv6 DNS server can be used. When receiving a DNS request packet, the device determines whether to preferentially select the IPv4 DNS server or IPv6 DNS server based on the DNS query type. For example, when a device receives a class A query request, it preferentially selects the IPv4 DNS server. If the query on all IPv4 DNS servers times out or no IPv4 DNS server is configured, the device sends a query packet to the IPv6 DNS server.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dns resolve

    The dynamic domain name resolution function is enabled.

    By default, the dynamic domain name resolution function is disabled.

  3. Configure an IP address of the DNS server.

    • The IP address of the DNS server is specified using commands.
      • Run dns server ip-address

        An IPv4 address is configured for the DNS server.

      • Run dns server ipv6 ipv6-address [ interface-type interface-number ]

        An IPv6 address is configured for the DNS server.

      By default, no IP address is configured for the DNS server.

    • The IP address of the DNS server is obtained from a specified interface.
      • Run dns server unnumbered interface interface-type interface-number

        The device is configured to use the IPv4 address of the DNS server obtained from the specified interface.

      • Run dns server ipv6 unnumbered interface interface-type interface-number { dhcpv6 | nd-ra }

        The device is configured to use the IPv6 address of the DNS server obtained from the specified interface.

      By default, the IP address of the DNS server obtained from a specified interface cannot be directly used.

  4. (Optional) Configure the source IP address for communication between the device and DNS server.

    • Run dns server source-ip ip-address

      The source IPv4 address used by the device to communicate with the IPv4 DNS server is configured.

    • Run dns server ipv6 source-ip ipv6-address

      The source IPv6 address used by the device to communicate with the IPv6 DNS server is configured.

    • Run dns server source-interface interface-type interface-number

      The IP address of the specified interface is configured as the source IP address of the DNS query messages sent by the device to the DNS server.

      This function is supported only if the device performs a DNS query through the DNS server with an IPv4 address and is not supported if the device performs a DNS query through the DNS server with an IPv6 address.

    By default, no source IP address is configured for the device to communicate with the DNS server. The device uses the IP address of the interface through which DNS query packets are sent to communicate with the DNS server.

  5. (Optional) Run dns server vpn-instance vpn-instance-name

    The device is configured to send DNS query requests to the DNS server on a specified VPN.

    By default, the device can only send DNS query requests to the DNS server on a public network.

    If you run this command multiple times, only the latest configuration takes effect.

    The device can send DNS query requests to the DNS server on a public network or specified VPN network.

    After a VPN instance is bound to the interface connected to the DNS client, the DNS proxy or relay function does not take effect.

  6. (Optional) Run dns domain domain-name

    The domain name suffix is configured.

    By default, no domain name suffix is configured.

  7. (Optional) Run dns application cache ttl maximum max-value minimum minimum-value

    The maximum and minimum life cycle for the DNS application cache is configured.

  8. (Optional) Configure the algorithm mode and retransmission mechanism for a device to send DNS query requests to the DNS server.

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

      The mode for the device to select the DNS server is configured.

      By default, the mode for a device to select the DNS server is auto.

    • Run dns forward retry-number number

      The number of times for the device to retransmit query requests to the destination DNS server is configured.

      By default, the number of times for a device to retransmit DNS query requests to the destination DNS server is 2.

    • Run dns forward retry-timeout time

      The retransmission timeout period for query requests sent by the device to the destination DNS server is configured.

      By default, the retransmission timeout period for DNS query requests sent by a device to the destination DNS server is 3 seconds.

    The total timeout period for DNS query requests configured by the dns forward retry-number and dns forward retry-timeout commands cannot be too short. Generally, the default value is recommended. If the time of waiting for the resolution response from the DNS server is too long, and services are interrupted, you can prolong the timeout period as required.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >