The dns server command configures an IP address for a DNS server.
The undo dns server command deletes the IP address of a DNS server.
By default, DNS servers do not have IP addresses.
Parameter | Description | Value |
---|---|---|
ip-address |
IP address of a DNS server. |
The value is in dotted decimal notation. |
vpn-instance vpn-instance-name |
Specifies the VPN to be displayed. |
The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string. |
Usage Scenario
If you want to obtain the IP addresses of destination hosts through their host names (for example, when you perform the ping or tracert operation), you need to run the dns resolve command to enable dynamic DNS. After dynamic DNS is enabled, you must run the dns server command to specify the IP addresses of the DNS servers, so as to obtain the mappings between the domain names and IP addresses of destination hosts.
Precautions
When using the dns server command, note the following:
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpn1 [*HUAWEI-vpn-instance-vpn1] ipv4-family [*HUAWEI-vpn-instance-vpn1-af-ipv4] quit [*HUAWEI-vpn-instance-vpn1] quit [*HUAWEI] dns server 172.16.1.2 vpn-instance vpn1
<HUAWEI> system-view [~HUAWEI] dns server 172.16.1.1