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.
dhcp server dns-list { ip-address &<1-8> | unnumbered interface interface-type interface-number }
undo dhcp server dns-list { all | ip-address | unnumbered interface }
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. |
- |
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
IP addresses in the interface address pool have been configured using the ip address command.
The DHCP server function has been enabled on the interface using the dhcp select interface command.
Precautions
<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
<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