Skip to content

dns: reimplement with C-based wire format parser#37

Merged
findstr merged 1 commit intomasterfrom
dns
Mar 2, 2026
Merged

dns: reimplement with C-based wire format parser#37
findstr merged 1 commit intomasterfrom
dns

Conversation

@findstr
Copy link
Owner

@findstr findstr commented Mar 2, 2026

No description provided.

Move DNS packet building and response parsing from pure Lua to a C
extension (ldns.c) for correctness and performance.

Key changes:
- Add ldns.c: C extension for DNS wire format encoding/decoding,
  supporting A, AAAA, CNAME, SRV, SOA record types with proper
  name pointer decompression and EDNS0 (4096-byte UDP payload)
- Add silly_push_resolvconf()/silly_push_hosts() to the public API,
  with platform-native implementations:
  - Unix: reads /etc/resolv.conf and /etc/hosts directly
  - Windows: calls GetNetworkParams() to enumerate DNS servers
- Add mock_dns_server.lua for comprehensive end-to-end DNS test coverage
- Add type definitions in lualib/types/silly/net/dns/c.lua
@findstr findstr merged commit 6daa4ff into master Mar 2, 2026
13 checks passed
@findstr findstr deleted the dns branch March 2, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant