proone-resolv
Interactive DNS resolver tool for testing the Resolv worker functionality.Overview
proone-resolv provides a command-line interface to the custom DNS resolver used by Proone. It supports A, AAAA, and TXT record queries over DNS-over-TLS (DoT).Usage
Query Format
A: IPv4 address recordsAAAA: IPv6 address recordsTXT: Text records
Example Session
Output Format
For each query, the tool outputs:<RESULT>: Query result (OK, STATUS, ERR_NS, ERR_SYS, ERRNO, TIMEOUT)<ERRNO>: System error number (if applicable)<CODE>: DNS response code number<RCODE>: DNS response code name (NOERROR, NXDOMAIN, etc.)
Example Output
DNS-over-TLS
The resolver uses hardcoded public DoT servers:- Default IPv4 pool defined in build configuration
- Default IPv6 pool defined in build configuration
- TLS encryption for all queries
- Connection reuse for efficiency
Server Selection
- Randomly selects from pool on errors
- Maintains connections between queries
- Falls back to other servers on errors
- Short connection timeout for offline detection
Query Model
Promise-future pattern:- Query is queued
- Future object returned
- Worker processes query asynchronously
- Results available through future
Special Features
TLS Configuration
- Uses hardcoded certificate and private key
- Makes packet analysis difficult
- Sends “close notify” on graceful shutdown
- Some servers may drop connection with RST (no side effects)
Independence
- Does not use system DNS configuration
- Only uses hardcoded DoT servers
- No dependency on
/etc/resolv.conf
Input Handling
- Lines starting with
#or;are ignored (comments) - Empty lines are ignored
- Invalid lines generate error messages
Exit Codes
| Code | Description |
|---|---|
| 0 | Success - all queries processed |
| 1 | No queries processed |
| 2 | Parse errors occurred |
| 3 | Both parse and query errors |
Signal Handling
Terminate with:SIGTERMSIGINT(Ctrl+C)- EOF on stdin
Threading
Uses GNU Pth for cooperative multitasking:- Main thread reads stdin
- Resolver worker processes queries
- Output worker writes results
Binary Data
For TXT records containing binary data:- Prints warning on terminal
- Outputs normally to files/pipes
- Checks if output is a TTY
Example Usage
Limitations
- Only supports A, AAAA, and TXT records
- No support for other DNS record types
- No DNSSEC validation
- Hardcoded server list (compile-time configuration)
Source
Location:src/proone-resolv.c