AddDnsFirewallPolicy
Creates a DNS firewall ACL.
Operation description
Creates a DNS firewall access control policy to allow, deny, or monitor traffic that passes through the DNS firewall.
Quotas
DNS firewall policies are counted independently in the DNS policy table (counted separately by IP version), but share the same quota limit with Internet access control policies (determined by the Cloud Firewall edition). If the number of address combinations expanded from a single policy exceeds the limit, or the total number of policies exceeds the limit, the system returns ErrorAclExtendedCountExceed (-200139).
The DescribeAclCheckQuota operation returns the quota for the number of ACL policy checks, which is unrelated to firewall policy count quota. You cannot use it to predict whether the quota for this operation is sufficient. Check firewall policy count quota in the Cloud Firewall console.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-cloudfirewall:AddDnsFirewallPolicy |
get |
*DnsFirewallPolicy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Lang |
string |
No |
The language of the request and response. Valid values:
|
zh |
| AclAction |
string |
Yes |
The action that Cloud Firewall performs on traffic in the access control policy. Valid values:
|
log |
| Description |
string |
Yes |
The description of the access control policy. |
Allow a specified domain name |
| Destination |
string |
Yes |
The destination address in the access control policy.
|
db_group |
| DestinationType |
string |
Yes |
The type of the destination address in the DNS firewall access control policy. Only group (destination address book) and domain (destination domain name) are supported. net and CIDR blocks are not supported by this operation. |
domain |
| Direction |
string |
No |
The traffic direction of the DNS firewall access control policy. Note
This parameter is not verified by the backend. When you create or modify a DNS firewall policy, the direction is always saved as out (outbound) in the database. If you pass in, no error is reported, but it does not take effect. DNS firewalls only support outbound policies. |
out |
| Source |
string |
Yes |
The source address in the access control policy. Valid values:
|
192.168.0.223/32 |
| SourceType |
string |
Yes |
The type of the source address in the access control policy. Valid values:
|
net |
| Priority |
string |
Yes |
The priority of the new DNS firewall policy. Valid values: 1 to 20000. A smaller value indicates a higher policy priority. |
1 |
| Release |
string |
Yes |
Specifies whether to enable the access control policy. By default, the policy is enabled after it is created. Valid values:
|
true |
| IpVersion |
string |
Yes |
The IP version. Valid values:
Valid values:
|
4 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| AclUuid |
string |
The unique ID of the access control policy. |
f88dae6f-XXX-XXX-613de9ab2be8 |
| RequestId |
string |
The ID of the request. |
71209DFE-XXX-XXX-52B4A4E9DA3B |
Examples
Success response
JSON format
{
"AclUuid": "f88dae6f-XXX-XXX-613de9ab2be8",
"RequestId": "71209DFE-XXX-XXX-52B4A4E9DA3B"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ErrorParametersUid | The aliUid parameter is invalid. | The aliUid parameter is invalid. |
| 400 | ErrorDBSelect | An error occurred while querying database. | An error occurred while querying database. |
| 400 | ErrorParameterIpVersion | The IP version is invalid. | The IP version is invalid. |
| 400 | ErrorParametersSource | The source is invalid. | The source is invalid. |
| 400 | ErrorParametersDestination | The Destination parameter is invalid. | The Destination parameter is invalid. |
| 400 | ErrorParametersAction | The action is invalid. | The action is invalid. |
| 400 | ErrorParametersNewOrder | The newOrder is invalid. | The newOrder is invalid. |
| 400 | ErrorParameters | Parameters error. | Parameter error. |
| 400 | ErrorAddressCountExceed | The maximum number of addresses is exceeded. | The maximum number of address is exceeded. |
| 400 | ErrorDBInsert | An error occurred while performing an insert operation in the database. | An error occurred while performing an insert operation in the database. |
| 400 | ErrorRecordLog | An error occurred while updating the operation log. | An error occurred while updating the operation log. |
| 400 | ErrorMarshalJSON | An error occurred while encoding JSON. | An error occurred while encoding JSON. |
| 400 | ErrorAclExtendedCountExceed | ACL or extended ACL rules are not matched. | ACL or extended ACL rules are not matched. |
| 400 | ErrorAclRuleDuplicate | acl rule duplicate. | The same strategy exists. |
| 400 | ErrorUUIDNew | The UUID is invalid. | The UUID is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.