Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Add DNS client library (libs/libbreenix/src/dns.rs) with full DNS protocol support
  • Add userspace DNS test program validating resolution via QEMU SLIRP DNS (10.0.2.3)
  • Fix network routing to always use gateway MAC for SLIRP compatibility
  • Add UDP ephemeral port allocation (bind port 0 support)
  • Add 4 DNS boot stages (181 total, all passing)

Changes

File Description
libs/libbreenix/src/dns.rs DNS protocol library - encoding, parsing, resolve()
userspace/tests/dns_test.rs Test: google.com, example.com, NXDOMAIN handling
kernel/src/net/mod.rs Route all traffic through gateway (SLIRP fix)
kernel/src/socket/mod.rs UDP ephemeral port allocation (49152-65535)
xtask/src/main.rs 4 DNS boot stages

Test plan

  • Build succeeds with no errors
  • All 181/181 boot stages pass
  • DNS google resolve - resolves www.google.com to valid public IP
  • DNS example resolve - resolves example.com
  • DNS NXDOMAIN - correctly handles nonexistent domains (RCODE 3)
  • Technical validation: A- accuracy, A honesty, APPROVED

🤖 Generated with Claude Code

Implement DNS resolution capability for Breenix OS:

- Add libs/libbreenix/src/dns.rs with full DNS protocol support
  - DNS header/response parsing per RFC 1035
  - Hostname wire-format encoding (label length prefixed)
  - Compression pointer handling in responses
  - A record extraction with TTL
  - Error types: NXDOMAIN, Timeout, ParseError, etc.

- Add userspace/tests/dns_test.rs test program
  - Resolve www.google.com via SLIRP DNS (10.0.2.3)
  - Resolve example.com as secondary domain
  - NXDOMAIN handling with strict error validation

- Fix network routing for SLIRP mode
  - Always route through gateway MAC (SLIRP emulates all hosts)
  - Enables DNS queries to 10.0.2.3

- Add UDP ephemeral port allocation
  - bind(port=0) allocates from 49152-65535 range
  - Required for DNS to receive responses

- Add 4 DNS boot stages (181 total, all passing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit a7bc553 into main Jan 12, 2026
1 check passed
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.

2 participants