mock-dns-server
v0.0.3
Published
Create a mock DNS-over-TLS server based on [mock-tls-server](https://github.com/hildjj/mock-tls-server/).
Downloads
13
Readme
mock-dns-server
Create a mock DNS-over-TLS server based on mock-tls-server.
Installation
npm install -D mock-dns-server
API
Full API documentation is available.
Example:
import {connect, createServer} from 'mock-dns-server';
/** @type {import('mock-dns-server').Zones} */
const zones = {
'xmpp.example.com': {
A: ['192.168.1.2', '192.168.1.3'],
},
'_xmpp-server._tcp.example.com': {
SRV: {
priority: 30,
weight: 30,
port: 5269,
target: 'xmpp.example.com',
},
},
};
const server = createServer({zones});
/** @type {import('node:tls').TLSSocket} */
const sock = connect(server.port);