Google Cloud offers Identity and Access Management (IAM), which lets you give more granular access to specific Google Cloud resources and prevents unwanted access to other resources. This page describes the Cloud DNS API roles. For a detailed description of IAM, see the Identity and Access Management documentation.
IAM lets you adopt the security principle of least privilege so that you grant only the necessary access to your resources.
IAM lets you control who has what permissions to which
resources by setting IAM policies. IAM policies
grant specific roles to a user, giving the user certain permissions. For
example, a particular user might need to create and modify Domain Name System
(DNS) record resources. You would then give that user (who) the
/roles/dns.admin role, which has the dns.changes.create and
dns.resourceRecordSets.create permissions (what) so that they can create and
update resource record sets (which). In contrast, a support department might
only need to view existing resource record sets, so they would get a
/roles/dns.reader role.
Cloud DNS supports IAM permissions at the project level and individual DNS zone level. The default permission is at the project level. To configure permissions at the individual DNS zone (or resource) level, see Create a zone with specific IAM permissions.
Permissions and roles
Every Cloud DNS API method requires the caller to have the necessary IAM permissions. Permissions are assigned by granting roles to a user, group, or service account. In addition to the basic roles Owner, Editor, and Viewer, you can grant Cloud DNS API roles to the users of your project.
Permissions
The following table lists the permissions that the caller must have to call each method.
| Method | Required permission(s) | 
|---|---|
| dns.changes.create | To create a resource record, set both dns.changes.createanddns.resourceRecordSets.createon the project containing the record set.To update a resource record, set both
         To delete a resource record, set both
           | 
| dns.changes.get | dns.changes.geton the project containing the managed zone. | 
| dns.changes.list | dns.changes.liston the project containing the managed zone. | 
| dns.dnsKeys.get | dns.dnsKeys.geton the project containing the managed zone. | 
| dns.dnsKeys.list | dns.dnsKeys.liston the project containing the managed zone. | 
| dns.managedZoneOperations.get | dns.managedZoneOperations.geton the project containing the managed zone. | 
| dns.managedZoneOperations.list | dns.managedZoneOperations.liston the project containing the managed zone. | 
| dns.managedZones.create | dns.managedZones.createon the project containing the
      managed zone.If you are creating a private zone, you also need
       If you are creating a private zone with GKE integration,
       you also need  | 
| dns.managedZones.delete | dns.managedZones.deleteon the project containing the managed zone. | 
| dns.managedZones.get | dns.managedZones.geton the project containing the managed zone. | 
| dns.managedZones.list | dns.managedZones.liston the project containing the
      managed zone. | 
| dns.managedZones.update | dns.managedZones.updateon the project containing the
      managed zone.If you are creating a private zone, you also need
       If you are creating a private zone with GKE integration,
       you also need  | 
| dns.policies.create | dns.policies.createon the project containing the policy.If the policy is created on a VPC network, you also need
       | 
| dns.policies.delete | dns.policies.deleteon the project containing the policy. | 
| dns.policies.get | dns.policies.geton the project containing the policy. | 
| dns.policies.list | dns.policies.liston the project containing the policy. | 
| dns.policies.update | dns.policies.updateon the project containing the policy.If the policy is updated to be on a VPC network, you also
      need  | 
| dns.projects.get | dns.projects.geton the project. | 
| dns.resourceRecordSets.create | dns.resourceRecordSets.createon the project containing the
      record set. | 
| dns.resourceRecordSets.delete | dns.resourceRecordSets.deleteon the project containing the
      record set. | 
| dns.resourceRecordSets.get | dns.resourceRecordSets.geton the project containing the
      record set. | 
| dns.resourceRecordSets.list | dns.resourceRecordSets.liston the project containing the
      managed zone. | 
| dns.resourceRecordSets.update | dns.resourceRecordSets.updateanddns.changes.createon the project containing the
      record set. | 
| dns.responsePolicies.create | dns.responsePolicies.createon the project containing the
      response policy.You also need
       If you want to create a response policy attached to a GKE cluster, you need
       | 
| dns.responsePolicies.delete | dns.responsePolicies.deleteon the project containing the
      response policy. | 
| dns.responsePolicies.get | dns.responsePolicies.geton the project containing the
      response policy. | 
| dns.responsePolicies.list | dns.responsePolicies.liston the project. | 
| dns.responsePolicies.update | dns.responsePolicies.updateon the project containing the
      response policy.You also need
       If you want to create a response policy attached to a GKE cluster, you need
       | 
| dns.responsePolicyRules.create | dns.responsePolicyRules.createon the project containing the
      response policy rule. | 
| dns.responsePolicyRules.delete | dns.responsePolicyRules.deleteon the project containing the
      response policy rule. | 
| dns.responsePolicyRules.get | dns.responsePolicyRules.geton the project containing the
      response policy rule. | 
| dns.responsePolicyRules.list | dns.responsePolicyRules.liston the project containing the
      response policy. | 
| dns.responsePolicyRules.update | dns.responsePolicyRules.updateon the project containing the
      response policy rule. | 
| networksecurity.dnsThreatDetectors.list(Preview) | networksecurity.dnsThreatDetectors.liston the project where the VPC networks are monitored for threats. | 
| networksecurity.dnsThreatDetectors.get(Preview) | networksecurity.dnsThreatDetectors.geton the project where the VPC networks are monitored for threats. | 
| networksecurity.dnsThreatDetectors.create(Preview) | networksecurity.dnsThreatDetectors.createon the project containing the VPC networks you want to monitor for threats. | 
| networksecurity.dnsThreatDetectors.update(Preview) | networksecurity.dnsThreatDetectors.updateon the project where the VPC networks are monitored for threats. | 
| networksecurity.dnsThreatDetectors.delete(Preview) | networksecurity.dnsThreatDetectors.deleteon the project where the VPC networks are monitored for threats. | 
Roles
The following table lists the Cloud DNS API IAM roles with a corresponding list of all the permissions that each role includes. Every permission is applicable to a particular resource type.
You can also use basic roles to make DNS changes.
| Role | Permissions | 
|---|---|
| DNS Administrator( Provides read-write access to all Cloud DNS resources. Lowest-level resources where you can grant this role: 
 | 
 
 
       
 
       
 
       
 
       
 
 
 
 
 
 
 
       
 
       
 
 
       
 
       
 
       
 
 
 | 
| DNS Peer( Access to target networks with DNS peering zones | 
 | 
| DNS Reader( Provides read-only access to all Cloud DNS resources. Lowest-level resources where you can grant this role: 
 | 
 
 
 
       
 
       
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 
| Cloud DNS Service Agent( Gives Cloud DNS Service Agent access to Cloud Platform resources. | 
 
 
 
 
 
 
 | 
| Role | Permissions | 
|---|---|
| DNS Threat Detector Admin Beta( Enables full access to DNS Threat Detector resources. | 
       
 
 
 | 
| DNS Threat Detector Viewer Beta( Enables view access to DNS Threat Detector resources. | 
 
 
 
 | 
Manage access control
You can use the Google Cloud console to manage access control for your topics and projects.
To set access controls at the project level, follow these steps.
Console
- In the Google Cloud console, go to the IAM page. 
- Select your project from the top pull-down menu. 
- Click Add. 
- In New principals, enter the email address of a new principal. 
- Select a role from the list. 
- Click Save. 
- Verify that the principal is listed with the role that you granted. 
What's next
- To get started using Cloud DNS, see Quickstart: Set up DNS records for a domain name with Cloud DNS.
- To find solutions for common issues that you might encounter when using Cloud DNS, see Troubleshooting.