This section describes how to configure DNS and establish mappings between domain names and IP addresses, so that a device can communicate with other devices using domain names.
Configuring a route between the DNS client and server, so that the DNS client and server can communicate
Configuring DNS servers
Run system-view
The system view is displayed.
Run ip host host-name ip-address [ vpn-instance vpn-name ]
The mapping between the domain name and IPv4 address of the host is configured.
Run commit
The configuration is committed.
Run system-view
The system view is displayed.
Run dns resolve
Dynamic DNS is enabled.
Run dns server ip-address [ vpn-instance vpn-name ]
A DNS server is configured.
(Optional) Run dns server source-ip [ vpn-instance vpn-name ] ipv4Addr
The IP address of the local router is specified.
An IP address is specified for the DNS client to communicate with the DNS server. Using a specified source address ensures the security of communication between the DNS client and DNS server.
Run dns domain domain-name [ vpn-instance vpn-name ]
A domain name suffix is added.
(Optional) Run dns timeout interval-time
A DNS query response timeout period is configured.
(Optional) Run dns try times
The number of retransmission times for DNS query packets is configured.
Run commit
The configuration is committed.
To configure multiple DNS servers, repeatedly perform Step 3. To configure multiple domain name suffixes, repeatedly perform Step 5.
After configuring a DNS client, verify the configuration.
Run the display ip host command to view static DNS entries, including mappings between domain names and IP addresses.
Run the display dns server command to view the IP addresses of all configured DNS servers.
Run the display dns domain command to view the domain name suffix list.
Run the display dns dynamic-host command to view dynamic DNS entries stored in the cache.