Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Google Cloud cung cấp tính năng Quản lý danh tính và quyền truy cập (IAM), cho phép bạn cấp quyền truy cập chi tiết hơn vào các tài nguyên Google Cloud cụ thể và ngăn chặn quyền truy cập không mong muốn vào các tài nguyên khác. Trang này mô tả các vai trò của API Cloud DNS. Để biết nội dung mô tả chi tiết về IAM, hãy xem tài liệu về Quản lý danh tính và quyền truy cập.
IAM cho phép bạn kiểm soát ai có quyền gì đối với tài nguyên nào bằng cách đặt chính sách IAM. Chính sách IAM cấp các vai trò cụ thể cho người dùng, đồng thời cấp cho người dùng một số quyền nhất định. Ví dụ: một người dùng cụ thể có thể cần tạo và sửa đổi tài nguyên bản ghi Hệ thống tên miền (DNS). Sau đó, bạn sẽ cấp cho người dùng đó (who) vai trò /roles/dns.admin, vai trò này có các quyền dns.changes.create và dns.resourceRecordSets.create (what) để họ có thể tạo và cập nhật tập hợp bản ghi tài nguyên (which). Ngược lại, một bộ phận hỗ trợ có thể chỉ cần xem các nhóm bản ghi tài nguyên hiện có, vì vậy, họ sẽ nhận được vai trò /roles/dns.reader.
Cloud DNS hỗ trợ các quyền IAM ở cấp dự án và cấp vùng DNS riêng lẻ. Quyền mặc định là ở cấp dự án.
Để định cấu hình quyền ở cấp vùng DNS (hoặc tài nguyên) riêng lẻ, hãy xem phần Tạo vùng có các quyền IAM cụ thể.
Quyền và vai trò
Mọi phương thức API Cloud DNS đều yêu cầu phương thức gọi phải có các quyền IAM cần thiết. Quyền được chỉ định bằng cách cấp vai trò cho một người dùng, nhóm hoặc tài khoản dịch vụ. Ngoài các vai trò cơ bản là Chủ sở hữu, Người chỉnh sửa và Người xem, bạn có thể cấp các vai trò API Cloud DNS cho người dùng dự án của mình.
Quyền
Bảng sau đây liệt kê các quyền mà phương thức gọi phải có để gọi từng phương thức.
dns.managedZones.create trên dự án chứa vùng được quản lý.
Nếu đang tạo một vùng riêng tư, bạn cũng cần có dns.networks.bindPrivateDNSZone và dns.networks.targetWithPeeringZone trên mỗi dự án có mạng VPC được uỷ quyền truy cập vào vùng đó.
Nếu đang tạo một vùng riêng tư có tích hợp GKE, bạn cũng cần có dns.gkeClusters.bindPrivateDNSZone để định cấu hình phạm vi cụm GKE.
dns.managedZones.update trên dự án chứa vùng được quản lý.
Nếu đang tạo một vùng riêng tư, bạn cũng cần có dns.networks.bindPrivateDNSZone và dns.networks.targetWithPeeringZone trên mỗi dự án có mạng VPC được uỷ quyền truy cập vào vùng đó.
Nếu đang tạo một vùng riêng tư có tích hợp GKE, bạn cũng cần có dns.gkeClusters.bindPrivateDNSZone để định cấu hình phạm vi cụm GKE.
dns.responsePolicyRules.update trên dự án chứa quy tắc chính sách phản hồi.
Vai trò
Bảng sau đây liệt kê các vai trò IAM của Cloud DNS API cùng với danh sách tương ứng gồm tất cả các quyền mà mỗi vai trò có. Mỗi quyền đều áp dụng cho một loại tài nguyên cụ thể.
Bạn cũng có thể sử dụng các vai trò cơ bản để thực hiện các thay đổi về DNS.
Role
Permissions
DNS Administrator
(roles/dns.admin)
Provides read-write access to all Cloud DNS resources.
Lowest-level resources where you can grant this role:
Managed zone
compute.networks.get
compute.networks.list
dns.changes.*
dns.changes.create
dns.changes.get
dns.changes.list
dns.dnsKeys.*
dns.dnsKeys.get
dns.dnsKeys.list
dns.gkeClusters.*
dns.gkeClusters.bindDNSResponsePolicy
dns.gkeClusters.bindPrivateDNSZone
dns.managedZoneOperations.*
dns.managedZoneOperations.get
dns.managedZoneOperations.list
dns.managedZones.create
dns.managedZones.delete
dns.managedZones.get
dns.managedZones.getIamPolicy
dns.managedZones.list
dns.managedZones.update
dns.networks.*
dns.networks.bindDNSResponsePolicy
dns.networks.bindPrivateDNSPolicy
dns.networks.bindPrivateDNSZone
dns.networks.targetWithPeeringZone
dns.networks.useHealthSignals
dns.policies.*
dns.policies.create
dns.policies.delete
dns.policies.get
dns.policies.list
dns.policies.update
dns.projects.get
dns.resourceRecordSets.*
dns.resourceRecordSets.create
dns.resourceRecordSets.delete
dns.resourceRecordSets.get
dns.resourceRecordSets.list
dns.resourceRecordSets.update
dns.responsePolicies.*
dns.responsePolicies.create
dns.responsePolicies.delete
dns.responsePolicies.get
dns.responsePolicies.list
dns.responsePolicies.update
dns.responsePolicyRules.*
dns.responsePolicyRules.create
dns.responsePolicyRules.delete
dns.responsePolicyRules.get
dns.responsePolicyRules.list
dns.responsePolicyRules.update
resourcemanager.projects.get
resourcemanager.projects.list
DNS Peer
(roles/dns.peer)
Access to target networks with DNS peering zones
dns.networks.targetWithPeeringZone
DNS Reader
(roles/dns.reader)
Provides read-only access to all Cloud DNS resources.
Lowest-level resources where you can grant this role:
Managed zone
compute.networks.get
dns.changes.get
dns.changes.list
dns.dnsKeys.*
dns.dnsKeys.get
dns.dnsKeys.list
dns.managedZoneOperations.*
dns.managedZoneOperations.get
dns.managedZoneOperations.list
dns.managedZones.get
dns.managedZones.list
dns.policies.get
dns.policies.list
dns.projects.get
dns.resourceRecordSets.get
dns.resourceRecordSets.list
dns.responsePolicies.get
dns.responsePolicies.list
dns.responsePolicyRules.get
dns.responsePolicyRules.list
resourcemanager.projects.get
resourcemanager.projects.list
Cloud DNS Service Agent
(roles/dns.serviceAgent)
Gives Cloud DNS Service Agent access to Cloud Platform resources.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Khó hiểu","hardToUnderstand","thumb-down"],["Thông tin hoặc mã mẫu không chính xác","incorrectInformationOrSampleCode","thumb-down"],["Thiếu thông tin/mẫu tôi cần","missingTheInformationSamplesINeed","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-04 UTC."],[[["\u003cp\u003eGoogle Cloud's Identity and Access Management (IAM) allows for granular control over who has access to specific Cloud DNS resources, preventing unwanted access.\u003c/p\u003e\n"],["\u003cp\u003eIAM policies assign roles to users, granting them specific permissions like creating or viewing DNS records, adhering to the principle of least privilege.\u003c/p\u003e\n"],["\u003cp\u003eCloud DNS supports IAM permissions at both the project level and the individual DNS zone level, offering flexibility in managing access.\u003c/p\u003e\n"],["\u003cp\u003eTo use Cloud DNS API methods, users need specific IAM permissions, which are granted through roles, such as DNS Administrator or DNS Reader.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud DNS API roles, such as \u003ccode\u003edns.admin\u003c/code\u003e, \u003ccode\u003edns.peer\u003c/code\u003e, and \u003ccode\u003edns.reader\u003c/code\u003e, have specific permissions associated with them that determine what actions they can perform on DNS resources.\u003c/p\u003e\n"]]],[],null,["# Roles and permissions\n\nGoogle Cloud offers Identity and Access Management (IAM), which lets you give more\ngranular access to specific Google Cloud resources and prevents unwanted\naccess to other resources. This page describes the Cloud DNS API roles. For a\ndetailed description of IAM, see the\n[Identity and Access Management documentation](/iam/docs).\n\nIAM lets you adopt the\n[security principle of least privilege](https://wikipedia.org/wiki/Principle_of_least_privilege)\nso that you grant only the necessary access to your resources.\n\nIAM lets you control *who* has *what* permissions to *which*\nresources by setting IAM policies. IAM policies\ngrant specific roles to a user, giving the user certain permissions. For\nexample, a particular user might need to create and modify Domain Name System\n(DNS) record resources. You would then give that user (who) the\n`/roles/dns.admin` role, which has the `dns.changes.create` and\n`dns.resourceRecordSets.create` permissions (what) so that they can create and\nupdate resource record sets (which). In contrast, a support department might\nonly need to view existing resource record sets, so they would get a\n`/roles/dns.reader` role.\n\nCloud DNS supports IAM permissions at the project level\nand individual DNS zone level. The default permission is at the project level.\nTo configure permissions at the individual DNS zone (or resource) level, see\n[Create a zone with specific IAM\npermissions](/dns/docs/zones/iam-per-resource-zones).\n\nPermissions and roles\n---------------------\n\nEvery Cloud DNS API method requires the caller to have the necessary\nIAM permissions. Permissions are assigned by granting roles to\na user, group, or service account. In addition to the basic roles Owner,\nEditor, and Viewer, you can grant Cloud DNS API roles to the users\nof your project.\n\n### Permissions\n\nThe following table lists the permissions that the caller must have to call\neach method.\n\n### Roles\n\nThe following table lists the Cloud DNS API IAM roles with\na corresponding list of all the permissions that each role includes. Every\npermission is applicable to a particular resource type.\n\nYou can also use [basic roles](/iam/docs/understanding-roles#basic) to make\nDNS changes. \n\nManage access control\n---------------------\n\nYou can use the Google Cloud console to manage access control for your\ntopics and projects.\n\nTo set access controls at the project level, follow these steps. \n\n### Console\n\n1. In the Google Cloud console, go to the **IAM** page.\n\n [Go to the IAM page](https://console.cloud.google.com/iam-admin/iam)\n2. Select your project from the top pull-down menu.\n\n3. Click **Add**.\n\n4. In **New principals**, enter the email address of a new principal.\n\n5. Select a role from the list.\n\n6. Click **Save**.\n\n7. Verify that the principal is listed with the role that you granted.\n\nWhat's next\n-----------\n\n- To get started using Cloud DNS, see [Quickstart: Set up DNS records for a domain name with Cloud DNS](/dns/docs/set-up-dns-records-domain-name).\n- To find solutions for common issues that you might encounter when using Cloud DNS, see [Troubleshooting](/dns/docs/troubleshooting)."]]