Google Cloud기반 서비스가 Cloud DNS를 사용하여 서비스 디렉터리 네임스페이스를 쿼리할 수 있도록 허용하는 서비스 디렉터리 영역을 만들 수 있습니다.
이 안내에서는 이미 서비스 디렉터리 네임스페이스가 설정되어 있어야 합니다. 네임스페이스가 없는 경우 먼저 서비스 디렉터리 구성의 절차에 따라 네임스페이스를 만듭니다.
서비스 디렉터리 영역을 네임스페이스에 연결하면 네임스페이스 내의 모든 서비스와 엔드포인트를 비공개 네트워크의 DNS를 통해 사용할 수 있습니다. 모든 서비스 및 엔드포인트 업데이트는 DNS 레코드에 즉시 반영됩니다. 그러나 DNS를 통해 서비스와 엔드포인트를 사용할 수는 없습니다.
이 태스크에 필요한 권한
이 태스크를 수행하려면 다음과 같은 권한 또는 다음과 같은 IAM 역할을 부여받아야 합니다.
권한
servicedirectory.namespaces.associatePrivateZone
역할
servicedirectory.admin
servicedirectory.editor
제한사항
서비스 디렉터리와 Cloud DNS의 통합에는 다음과 같은 제한사항이 있습니다.
서비스 디렉터리 영역은 영역을 만들 때만 네임스페이스와 연결할 수 있습니다.
서비스 디렉터리 영역은 연결된 서비스 디렉터리 네임스페이스와 동일한 프로젝트에 있어야 합니다.
서비스 디렉터리 영역은 전달 영역, 일반 비공개 영역 또는 공개 영역이 될 수도 없습니다.
네임스페이스로 지원되는 서비스 디렉터리 영역 만들기
서비스 디렉터리 영역은 영역을 만들 때만 네임스페이스와 연결할 수 있습니다. 서비스 디렉터리 영역은 전달 영역, 일반 비공개 영역 또는 공개 영역일 수도 없습니다.
DNS_NAME: 새 영역의 DNS 이름(예: us-east1.example.com.)입니다.
DESCRIPTION: 영역에 대한 설명입니다(예: this zone
is backed by Service Directory).
https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/networks/NETWORK: 이 영역을 사용할 수 있는 네트워크의 FQDN입니다.
https://www.servicedirectory.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/registries/NAMESPACE_NAME: 연결하는 네임스페이스의 FQDN입니다.
서비스 디렉터리 영역 삭제
언제든지 서비스 디렉터리 영역을 삭제할 수 있습니다. 이 삭제는 Cloud DNS를 통해 이루어지며 연결된 서비스 디렉터리 네임스페이스에는 영향을 미치지 않습니다. 연결된 네임스페이스는 HTTP 및 gRPC를 통해 계속 조회할 수 있습니다. 자세한 내용은 관리형 영역 삭제를 참고하세요.
영역을 삭제하지 않고도 서비스 디렉터리 영역이 가리키는 서비스 또는 네임스페이스를 삭제할 수 있습니다. 이 경우 해당 서비스에 대한 추가 DNS 쿼리는 NXDOMAIN를 반환합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Configure a DNS zone\n\nYou can create a Service Directory zone that allows your\nGoogle Cloud-based services to query your Service Directory namespace\nusing Cloud DNS.\n\nThese instructions require that you already have a Service Directory\nnamespace in place. If you do not, first create a namespace using the\nprocedure in [Configuring\nService Directory](/service-directory/docs/configuring-service-directory).\n\nOnce you have attached a Service Directory zone to the namespace, all\nservices and endpoints within the namespace become available over DNS on the\nprivate network. All service and endpoint updates are immediately reflected in\ntheir DNS records. However, the service and the endpoint are not available\nover DNS.\n\n#### Permissions required for this task\n\nTo perform this task, you must have been granted the following permissions\n*or* the following IAM roles.\n\n**Permissions**\n\n- `servicedirectory.namespaces.associatePrivateZone`\n\n**Roles**\n\n- `servicedirectory.admin`\n- `servicedirectory.editor`\n| **Note:** Service visibility (*who* is authorized to look up a service) changes once a Service Directory private zone is assigned to a namespace. The network, not IAM, determines the access when responding to DNS queries. For more details, see [Roles and permissions](/dns/docs/access-control).\n\nLimitations\n-----------\n\nService Directory integration with Cloud DNS has the following\nlimitations:\n\n- You can only associate a Service Directory zone with a namespace when you create the zone.\n- A Service Directory zone must be in the same project as the Service Directory namespace that it is associated with.\n- A Service Directory zone cannot also be a forwarding zone, a regular private zone, or a public zone.\n\nCreate a Service Directory zone backed by a namespace\n-----------------------------------------------------\n\nYou can only associate a Service Directory zone with a namespace when you\ncreate the zone. A Service Directory zone cannot also be a forwarding zone,\na regular private zone, or a public zone. \n\n### Console\n\n1. Go to the Cloud DNS page in the Google Cloud console. \n [Go to Cloud DNS](https://console.cloud.google.com/net-services/dns/zones)\n2. Click **Create zone**.\n3. In the **Zone type** section, click **Private**.\n4. Enter a name for the zone.\n5. Enter a DNS name for the zone.\n6. Under **Options** , select **Use a service directory namespace**.\n7. Under **Networks**, select one or more networks that can use the Service Directory zone.\n8. Select the **Region** where the namespace that you want to link lives.\n9. Select the **Namespace** that you want to link.\n10. Click **Create**.\n\n### gcloud\n\n```\ngcloud dns managed-zones create SD_ZONE \\\n --dns-name DNS_NAME \\\n --description DESCRIPTION \\\n --visibility private \\\n --networks https://www.googleapis.com/compute/v1/projects/project_ID/global/networks/network \\\n --service-directory-namespace https://servicedirectory.googleapis.com/v1/projects/project_ID/locations/region/namespaces/namespace-name\n```\n\nReplace the following values:\n\n- \u003cvar translate=\"no\"\u003eSD_ZONE\u003c/var\u003e: the name of the Service Directory zone that you are creating.\n- \u003cvar translate=\"no\"\u003eDNS_NAME\u003c/var\u003e: the DNS name, such as `us-east1.example.com.`, for the new zone.\n- \u003cvar translate=\"no\"\u003eDESCRIPTION\u003c/var\u003e: a description of the zone, such as `this zone\n is backed by Service Directory`.\n- https://www.googleapis.com/compute/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/global/networks/\u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e: the FQDN of the networks that can use the zone.\n- https://www.servicedirectory.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e/registries/\u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e: the FQDN of the namespace that you are linking.\n| **Note:** You can associate only one Service Directory zone with a given namespace, and you cannot associate a given zone with multiple namespaces. You must create the Cloud DNS zone and the Service Directory namespace in the same project.\n\nDelete the Service Directory zone\n---------------------------------\n\nAt any point, you can delete a Service Directory zone. This deletion\nhappens through Cloud DNS and has no effect on any associated\nService Directory namespaces. The associated namespace continues to be\navailable for look up through HTTP and gRPC. For more information, see\n[Delete a managed zone](/dns/docs/zones#delete_a_managed_zone).\n\nYou can [delete a\nservice](/service-directory/docs/configuring-service-directory#deleting_a_service_from_a_namespace)\nor namespace that has a Service Directory zone pointing to it without\ndeleting the zone. If you do, any further DNS queries for that service return\n`NXDOMAIN`.\n\nWhat's next\n-----------\n\n- To learn how to secure Service Directory in a service perimeter, see [Service Directory and VPC Service Controls](/service-directory/docs/securing-with-vpc-sc).\n- To get an overview of Service Directory, see the [Service Directory overview](/service-directory/docs/overview).\n- To find solutions for common issues that you might encounter when using Service Directory, see [Troubleshooting](/service-directory/docs/troubleshooting)."]]