gcloud beta dns response-policies rules create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta dns response-policies rules create - creates a new Cloud DNS response policy rule
- SYNOPSIS
gcloud beta dns response-policies rules create(RESPONSE_POLICY_RULE:--response-policy=RESPONSE_POLICY)--dns-name=DNS_NAME[--behavior=BEHAVIOR][--local-data=[LOCAL_DATA,…]][--location=LOCATION][GCLOUD_WIDE_FLAG …]
- EXAMPLES
- To create a new response policy rule with local data rrsets, run:
gcloudbetadnsresponse-policiesrulescreatemyresponsepolicyrule--response-policy="myresponsepolicy"--dns-name="www.zone.com."--local-data=name=www.zone.com.,type=CNAME,ttl=21600,rrdatas=zone.com.To create a new response policy rule with behavior, run:
gcloudbetadnsresponse-policiesrulescreatemyresponsepolicyrule--response-policy="myresponsepolicy"--dns-name="www.zone.com."--behavior=bypassResponsePolicyTo create a new response policy rule with behavior in a zonal response policy inus-east1-a, run:
gcloudbetadnsresponse-policiesrulescreatemyresponsepolicyrule--response-policy="myresponsepolicy"--dns-name="www.zone.com."--behavior=bypassResponsePolicy--location=us-east1-a - POSITIONAL ARGUMENTS
- Response policy rule resource - The response policy rule to create. Thearguments in this group can be used to specify the attributes of this resource.(NOTE) Some attributes are not given arguments in this group but can be set inother ways.
To set the
projectattribute:- provide the argument
response_policy_ruleon the command line witha fully specified name; - set the property
core/project.
This must be specified.
RESPONSE_POLICY_RULE- ID of the response_policy_rule or fully qualified identifier for theresponse_policy_rule.
To set the
response-policy-ruleattribute:- provide the argument
response_policy_ruleon the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--response-policy=RESPONSE_POLICY- The Cloud DNS response policy name response_policy_rule.
To set the
response-policyattribute:- provide the argument
response_policy_ruleon the command line witha fully specified name; - provide the argument
--response-policyon the command line.
- provide the argument
- provide the argument
- Response policy rule resource - The response policy rule to create. Thearguments in this group can be used to specify the attributes of this resource.(NOTE) Some attributes are not given arguments in this group but can be set inother ways.
- REQUIRED FLAGS
--dns-name=DNS_NAME- DNS name (wildcard or exact) to apply this rule to.
- OPTIONAL FLAGS
--behavior=BEHAVIOR- The response policy rule query behavior.
BEHAVIORmustbe one of:behaviorUnspecified,bypassResponsePolicy. --local-data=[LOCAL_DATA,…]- All resource record sets for this selector, one per resource record type. Thename must match the dns_name.
This is a repeated argument that can be specified multiple times to specifymultiple local data rrsets. (e.g.--local-data=name="zone.com.",type="A",ttl=21600,rrdata="1.2.3.4 "--local-data=name="www.zone.com.",type="CNAME",ttl=21600,rrdata="1.2.3.4|5.6.7.8")
name- The DnsName of a resource record set.
type- Type of all resource records in this set. For example, A, AAAA, SOA, MX, NS, TXT…
ttl- Number of seconds that this ResourceRecordSet can be cached by resolvers.
rrdatas- The list of datas for this record, split by "|".
--location=LOCATION- Specifies the desired service location the request is sent to. Defaults to CloudDNS global service. Use --location=global if you want to target the globalservice.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in beta and might change without notice. Thesevariants are also available:
gclouddnsresponse-policiesrulescreategcloudalphadnsresponse-policiesrulescreate
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-17 UTC.