This section provides an example for configuring a DNS domain name suffix using the edit-config method.
Operation |
XPATH |
|---|---|
edit-config |
|
Item |
Data |
Description |
|---|---|---|
Dynamic DNS function |
true |
Enable the dynamic DNS function. |
Index when multiple DNS server IP addresses are configured. |
huawei |
The index value is a character string. Set the index to huawei. A maximum of six DNS server IP addresses (IPv4 and IPv6 addresses) can be configured on a switch. |
DNS server IP address |
10.1.1.1 |
Set the IP address of the DNS server to 10.1.1.1. |
Domain name suffix |
huawei.com |
Set the domain name suffix to huawei.com. |
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-dns:dns xmlns:hw-dns="urn:huawei:params:xml:ns:yang:huawei-dns">
<hw-dns:dns-common>
<hw-dns:dns-resolve-enable>true</hw-dns:dns-resolve-enable>
<hw-dns:dns-server>
<hw-dns:name>huawei</hw-dns:name>
<hw-dns:ipv4>
<hw-dns:ip-address>10.1.1.1</hw-dns:ip-address>
</hw-dns:ipv4>
</hw-dns:dns-server>
</hw-dns:dns-common>
<hw-dns:dns-client>
<hw-dns:domain-suffixes>
<hw-dns:domain-suffix>huawei.com</hw-dns:domain-suffix>
</hw-dns:domain-suffixes>
</hw-dns:dns-client>
</hw-dns:dns>
</config>
</edit-config>
</rpc>
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-path>/huawei-dns:dns/dns-common/dns-server[name='huawei']/ipv4/ip-address</error-path>
<error-message>parse rpc config error.(Value "10.1.1.289" does not satisfy the constraint "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?" (range, length, or pattern).).</error-message>
</rpc-error>
</rpc-reply>