feat(rustdns-client): add Rust DNS client binary and TypeScript IPC bridge to enable UDP and DoH resolution, RDATA decoding, and DNSSEC AD/rcode support

This commit is contained in:
2026-02-11 13:02:37 +00:00
parent 9d4db39741
commit 368430d199
24 changed files with 2805 additions and 863 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartdns',
version: '7.7.1',
version: '7.8.0',
description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.'
}

47
ts/readme.md Normal file
View File

@@ -0,0 +1,47 @@
# @push.rocks/smartdns
Unified entry point that re-exports both the DNS client and DNS server modules.
## Import
```typescript
import { dnsClientMod, dnsServerMod } from '@push.rocks/smartdns';
```
## Modules
| Module | Description |
|---|---|
| `dnsClientMod` | DNS resolution — system, UDP, DoH strategies via `Smartdns` class |
| `dnsServerMod` | Authoritative DNS server — UDP, HTTPS, DNSSEC, ACME via `DnsServer` class |
## Usage
```typescript
import { dnsClientMod, dnsServerMod } from '@push.rocks/smartdns';
// Client
const client = new dnsClientMod.Smartdns({ strategy: 'prefer-udp' });
const records = await client.getRecordsA('example.com');
client.destroy();
// Server
const server = new dnsServerMod.DnsServer({
udpPort: 5333,
httpsPort: 8443,
httpsKey: '...',
httpsCert: '...',
dnssecZone: 'example.com',
});
server.registerHandler('example.com', ['A'], (q) => ({
name: q.name, type: 'A', class: 'IN', ttl: 300, data: '93.184.215.14',
}));
await server.start();
```
For direct imports, use the sub-module paths:
```typescript
import { Smartdns } from '@push.rocks/smartdns/client';
import { DnsServer } from '@push.rocks/smartdns/server';
```