class DnsBlockResponse
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Route53Resolver.DnsBlockResponse |
Java | software.amazon.awscdk.services.route53resolver.DnsBlockResponse |
Python | aws_cdk.aws_route53resolver.DnsBlockResponse |
TypeScript (source) | @aws-cdk/aws-route53resolver » DnsBlockResponse |
The way that you want DNS Firewall to block the request.
Example
declare const myBlockList: route53resolver.FirewallDomainList;
declare const ruleGroup: route53resolver.FirewallRuleGroup;
ruleGroup.addRule({
priority: 10,
firewallDomainList: myBlockList,
// block and reply with NXDOMAIN
action: route53resolver.FirewallRuleAction.block(route53resolver.DnsBlockResponse.nxDomain()),
});
ruleGroup.addRule({
priority: 20,
firewallDomainList: myBlockList,
// block and override DNS response with a custom domain
action: route53resolver.FirewallRuleAction.block(route53resolver.DnsBlockResponse.override('amazon.com')),
});
Initializer
new DnsBlockResponse()
Properties
Name | Type | Description |
---|---|---|
block | string | The DNS record's type. |
block | string | The custom DNS record to send back in response to the query. |
block | Duration | The recommended amount of time for the DNS resolver or web browser to cache the provided override record. |
block | string | The way that you want DNS Firewall to block the request. |
blockOverrideDnsType?
Type:
string
(optional)
The DNS record's type.
blockOverrideDomain?
Type:
string
(optional)
The custom DNS record to send back in response to the query.
blockOverrideTtl?
Type:
Duration
(optional)
The recommended amount of time for the DNS resolver or web browser to cache the provided override record.
blockResponse?
Type:
string
(optional)
The way that you want DNS Firewall to block the request.
Methods
Name | Description |
---|---|
static no | Respond indicating that the query was successful, but no response is available for it. |
static nx | Respond indicating that the domain name that's in the query doesn't exist. |
static override(domain, ttl?) | Provides a custom override response to the query. |
Data()
static nopublic static noData(): DnsBlockResponse
Returns
Respond indicating that the query was successful, but no response is available for it.
Domain()
static nxpublic static nxDomain(): DnsBlockResponse
Returns
Respond indicating that the domain name that's in the query doesn't exist.
static override(domain, ttl?)
public static override(domain: string, ttl?: Duration): DnsBlockResponse
Parameters
- domain
string
— The custom DNS record to send back in response to the query. - ttl
Duration
— The recommended amount of time for the DNS resolver or web browser to cache the provided override record.
Returns
Provides a custom override response to the query.