
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
node-powerdns
Advanced tools
A typed PowerDNS Authoritative HTTP API client for Node.js.
This library wraps the PowerDNS API with a small, fetch-based client and exposes TypeScript types for the main Authoritative server resources.
You can import the client as either the default export or the named Client export.
version client option.localhost.extra config field for attaching caller-specific metadata to a client instance.fetch() available in modern Node.js.fetch override for custom transport behavior.npm install node-powerdns
Node.js 18 or newer is recommended because the client relies on the built-in fetch() API.
import { Client, Versions } from 'node-powerdns';
const client = new Client({
baseUrl: 'http://127.0.0.1:8081',
apiKey: process.env.POWERDNS_API_KEY!,
version: '/api/v1',
server: { id: 'localhost' }
});
Default import is also supported:
import PowerDNS, { Versions } from 'node-powerdns';
const client = new PowerDNS({
baseUrl: 'http://127.0.0.1:8081',
apiKey: process.env.POWERDNS_API_KEY!,
version: '/api/v1'
});
const server = await client.servers.get();
console.log(server.id);
console.log(server.version);
const zones = await client.zones().list({ dnssec: false });
for (const zone of zones) {
console.log(zone.name, zone.kind);
}
new Client(config)type ClientConfig<E = unknown> = {
baseUrl: string;
apiKey: string;
version?: string;
server?: { id: string };
extra?: E;
fetch?: typeof fetch;
logger?: {
error?: (error: { error: string; errors?: string[] }) => void;
};
};
The client trims a trailing slash from baseUrl, defaults version to '/api/v1', and uses server.id = 'localhost' when no server is provided.
client.serversawait client.servers.list();
await client.servers.get();
Use this to enumerate available PowerDNS servers or inspect the configured default server.
client.zones(server?)import { ZoneType } from 'node-powerdns';
const zones = client.zones();
await zones.list();
await zones.get({ id: 'example.org.' });
await zones.create({
name: 'example.org.',
kind: ZoneType.Native
});
The zone API also exposes helpers for updates, deletes, AXFR retrieval, notifications, export, rectify, and RRSet-level operations.
client.zones().rrset(zone, target)await client
.zones()
.rrset({ id: 'example.org.' }, { name: 'www.example.org.', type: 'A', ttl: 300 })
.create({
record: { content: '203.0.113.10', disabled: false }
});
Use the RRSet helper to create, update, or delete records inside an existing zone.
client.metrics.get()const metrics = await client.metrics.get();
console.log(metrics);
This calls the webserver metrics endpoint and returns the raw text response.
import { Versions, ZoneType, type ZoneCreateRequest, type ZoneUpdateRequest } from 'node-powerdns';
baseUrl should point at the PowerDNS webserver root, for example http://127.0.0.1:8081.version defaults to '/api/v1'; set it explicitly if your deployment uses a different API path.server.id defaults to localhost if omitted.fetch can be supplied to override the internal HTTP implementation for all requests, including metrics.logger.error can be supplied to observe PowerDNS error payloads without forcing library-level console logging.This client exposes grouped API helpers:
client.configclient.serversclient.metricsclient.zones(server?)client.viewsclient.networksclient.cryptokeysclient.metadataclient.tsigkeysclient.autoprimariesclient.searchclient.statisticsclient.cacheimport { Client, Versions } from 'node-powerdns';
const client = new Client({
baseUrl: 'http://127.0.0.1:8081',
apiKey: process.env.POWERDNS_API_KEY!,
version: '/api/v1'
});
const zone = await client.zones().get({ id: 'example.org.' }, { rrsets: true });
console.log(zone.rrsets.length);
import { Client, Versions, type Error as PowerDNSError } from 'node-powerdns';
const client = new Client({
baseUrl: 'http://127.0.0.1:8081',
apiKey: process.env.POWERDNS_API_KEY!,
version: '/api/v1'
});
try {
await client.servers.get();
} catch (error) {
const apiError = error as PowerDNSError;
console.error(apiError.error);
console.error(apiError.errors);
}
X-API-Key.Apache 2.0. See LICENSE.
FAQs
TypeScript PowerDNS Authoritative API client for Node.js
The npm package node-powerdns receives a total of 9 weekly downloads. As such, node-powerdns popularity was classified as not popular.
We found that node-powerdns demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.