< Home

dhcp server dns-list

Function

The dhcp server dns-list command configures DNS server addresses for an interface address pool.

The undo dhcp server dns-list command deletes the specified DNS server addresses of an interface address pool.

By default, no DNS server address is configured in an interface address pool.

Format

dhcp server dns-list { ip-address &<1-8> | unnumbered interface interface-type interface-number }

undo dhcp server dns-list { all | ip-address | unnumbered interface }

Parameters

Parameter Description Value

ip-address

Specifies the IP address of the DNS server. You can configure up to eight IP addresses for the DNS servers and separate two IP addresses with a space.

The value is in dotted decimal notation.

unnumbered interface interface-type interface-number

Borrows the DNS server address obtained by the interface as the DNS server IP address.

-

all

Deletes all IP addresses of DNS servers specified for the client.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. If user hosts access hosts on the network through the domain name, user hosts need to send DNS Request messages to the DNS server and resolve the domain name. To enable DNS services on the DHCP client, specify the DNS server address for the interface address pool on the DHCP server. The DHCP server can assign both the specified DHCP server address and an IP address to the client. To configure DNS server addresses for a global address pool, run the dns-list command.

Prerequisites

  1. The DHCP function has been enabled using the dhcp enable command in the system view.
  2. IP addresses in the interface address pool have been configured using the ip address command.

  3. The DHCP server function has been enabled on the interface using the dhcp select interface command.

Precautions

  • Each address pool can be configured with a maximum of eight DNS server addresses. If multiple DNS server addresses are configured, the first DNS server address assigned to the DHCP client functions as the primary address and other addresses are secondary addresses.
  • To specify multiple DNS servers, enter multiple DNS server addresses in the dhcp server dns-list command.

Example

# Specify a DNS server at 10.10.1.254 for domain name resolution when IP addresses in the interface address pool on VLANIF100 are assigned to clients.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.1 24
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server dns-list 10.10.1.254
# Specify a DNS server at 192.168.1.254 for domain name resolution when IP addresses in the interface address pool on GE0/0/1 are assigned to clients.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ip address 10.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server dns-list 192.168.1.254
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >