Skip to main content

Get

Returns the specified DNS zone.

To get the list of all available DNS zones, make a List request.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetDnsZoneRequest = cloudApi.dns.dns_zone_service.GetDnsZoneRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.DnsZoneServiceClient);

const result = await client.get(
GetDnsZoneRequest.fromPartial({
dnsZoneId: "dnsZoneId",
})
);
console.log(result);
})();

GetDnsZoneRequest

dnsZoneId : string

ID of the DNS zone to return.

To get a DNS zone ID, make a DnsZoneService.List request.

DnsZone

A DNS zone. For details about the concept, see DNS zones.

id : string

ID of the DNS zone. Generated at creation time.

folderId : string

ID of the folder that the DNS zone belongs to.

createdAt : google.protobuf.Timestamp

Creation timestamp.

name : string

Name of the DNS zone. The name is unique within the folder.

description : string

Description of the DNS zone.

labels : string

DNS zone labels as key:value pairs.

zone : string

DNS zone suffix.

privateVisibility : PrivateVisibility

Privately visible zone settings. Specifies whether records within the zone are visible from a VPC networks only.

publicVisibility : PublicVisibility

Publicly visible zone settings. Indicates whether records within the zone are publicly visible.

deletionProtection : bool

Prevents accidental zone removal.

PrivateVisibility

Configuration for privately visible zones.

networkIds : string

Network IDs.

PublicVisibility

Configuration for publicly visible zones.