dns
Command Function
This command is used to query and set the IP address of a DNS server on a board.
Syntax
dns <1-2> <IP>
dns -a
Parameters
Table 1 Parameter description
Usage
None
Example
Example:
- Check the current DNS settings.
- Set the IP address of the alternate DNS server.
- Check the settings.
Output
-
Check the current DNS settings:
OHOS # dns -a dns1: 192.168.1.10 dns2: 0.0.0.0
-
Set the IP address of the alternate DNS server:
OHOS # dns 2 192.168.1.2
-
Check the settings:
OHOS # dns -a dns1: 192.168.1.10 dns2: 192.168.1.2