You can configure DNS server parameters for the DHCPv4 client. This allows the DHCPv4 client to automatically obtain DNS services automatically. Then, users can use easy-to-memorize domain names rather than complicated IP addresses.
Perform the following operations on the device if the device that functions as a DHCPv4 server needs to provide DNS services for DHCPv4 clients.
The system view is displayed.
An IP address pool is created, and the IP address pool view is displayed.
The DNS suffix of the IP address pool is configured.
This command is valid for only the local address pool and server address pool.
The IP address of the DNS server for the address pool is configured.
If IP addresses are automatically allocated from the BAS address pool, the DNS server can be configured in both the domain view and the address pool view, but the configuration in the domain view takes precedence.
The search domain is configured.
If a client sends a packet carrying Option 119 to request search domain information from the DHCP server, the domain-search-list domain-name command can be used to configure a search domain so that the DHCP server can send required search domain information to the user. After the domain-search-list domain-name command is run and the first domain name resolution fails, the configured search domain is used for resolution.
The configuration is committed.
On the DHCPv4 server, designate a DNS suffix for each address pool used to assign IP addresses to clients.
When a host accesses the Internet by using the DNS suffix, the DNS server resolves the DNS suffix into an IP address. Therefore, to ensure that the client successfully accesses the Internet, the DHCPv4 server also needs to specify the DNS server address for the client when it assigns IP addresses.
To improve network reliability, you can configure several DNS servers.