Registry / devops / oci-dns

oci-dns

JSON →
library2.132.0jsnpmunverified

Oracle Cloud Infrastructure (OCI) DNS client library for Node.js and TypeScript. Version 2.132.0. Official SDK from Oracle for managing DNS zones, records, steering policies, and resolver endpoints. Ships with TypeScript types. Part of the monolithic oci-typescript-sdk, released frequently alongside other OCI services. Replaced older sdks; authentication relies on OCI config files, instance principals, or resource principals. Key differentiator: official support and alignment with OCI API updates. Requires OCI account and API signing key.

npm install oci-dns
INSTALL
IMPORT
SIG · OCI-DNS
O
oci-dns
devopsjavascriptv2.132.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DnsClient
import { DnsClient } from 'oci-dns'
const { DnsClient } = require('oci-dns')
CommonJS require is also valid but less common in TypeScript projects. Use named import for ESM/TypeScript.
models
import * as models from 'oci-dns/lib/models'
import { models } from 'oci-dns'
models is a namespace, not a named export from the main module. Import from 'oci-dns/lib/models'.
Zone
import { Zone } from 'oci-dns/lib/models'
import { Zone } from 'oci-dns'
Model types are in the 'lib/models' subpath. The main 'oci-dns' does not export them directly.

Initializes DNS client using OCI config file auth and lists zones in a compartment.

import { DnsClient } from 'oci-dns'; import common = require('oci-common'); const provider = new common.ConfigFileAuthenticationDetailsProvider(); const client = new DnsClient({ authenticationDetailsProvider: provider }); async function listZones() { const zones = await client.listZones({ compartmentId: process.env.OCI_COMPARTMENT_ID ?? '' }); console.log(zones.items); } listZones();
Debug
Known issues
breakingOCI SDK v2 changed namespace from 'oci-dns-sdk' to 'oci-dns' and restructured imports.
fix
Update imports to 'oci-dns'. See migration guide.
affects: <2.0.0
deprecatedSome API versions may deprecate older zone operations; check OCI API changelog.
fix
Use current API version specified in client constructor options.
affects: >=2.0.0
gotchaAuthentication details provider must be configured correctly; ConfigFileAuthenticationDetailsProvider requires ~/.oci/config file.
fix
Ensure OCI config file is present. For other auth methods, use InstancePrincipalsAuthenticationDetailsProvider or ResourcePrincipalAuthenticationDetailsProvider.
affects: >=2.0.0
gotchaAll async methods are promise-based; callbacks are not supported. Missing await will cause silent failures.
fix
Use async/await or .then().
affects: >=2.0.0
gotchaSDK uses ES modules internally; importing in CommonJS env may require dynamic import or esModuleInterop.
fix
Set TypeScript 'module' to 'commonjs' or use 'esModuleInterop: true'.
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'oci-dns'
Package not installed or wrong import path.
fix
Run 'npm install oci-dns' and use correct import: 'import { DnsClient } from 'oci-dns'
Property 'listZones' does not exist on type 'DnsClient'.
TypeScript types not recognized or wrong version.
fix
Ensure package and types are installed: 'npm install oci-dns @types/oci-dns' (if needed) and check TypeScript version.
ERROR: OCI SDK: Could not find config file at ~/.oci/config
Missing OCI configuration file or incorrect permissions.
fix
Create ~/.oci/config with proper format or set environment variables OCI_CONFIG_FILE.
SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided.
Private key does not match public key uploaded to OCI user.
fix
Verify the key pair: upload correct public key to OCI user and ensure private key path is correct in config file.
Upgrade
Version history
2.132.0latest on npm
Audit
Dependencies
oci-commonrequiredProvides base client, authentication, and region handling for all OCI service clients
Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
oci-dns — npm install oci-dns · libregistry