Skip to content

Resolve DNS records in Node PHP runtimes - #4172

Draft
chubes4 wants to merge 3 commits into
WordPress:trunkfrom
chubes4:fix/4171-node-dns-records
Draft

Resolve DNS records in Node PHP runtimes#4172
chubes4 wants to merge 3 commits into
WordPress:trunkfrom
chubes4:fix/4171-node-dns-records

Conversation

@chubes4

@chubes4 chubes4 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What

Replace the hardcoded DNS polyfill results with a Node resolver bridge for dns_check_record() / checkdnsrr(), dns_get_record(), and dns_get_mx() / getmxrr().

Supported records: A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SOA, SRV, and TXT. Browser runtimes retain the existing unsupported false/empty behavior.

The bridge supports both Asyncify and JSPI, preserves PHP 5/7+ Zend ownership conventions, and returns PHP-compatible record and by-reference MX array shapes.

Closes #4171.

Verification

  • npx nx lint php-wasm-node
  • npx tsc --noEmit -p packages/php-wasm/node/tsconfig.lib.json
  • npx vitest run src/lib/wasm-user-space.spec.ts --config vite.config.ts
  • PHP 8.4 Node Asyncify rebuild and A/MX integration test
  • PHP 8.4 Node JSPI rebuild and A/MX integration test
  • git diff --check

The focused runtime tests pass for rebuilt PHP 8.4 in both modes. Other checked-in PHP versions still carry the old binary until CI rebuilds them.

AI assistance

OpenCode with openai/gpt-5.6-sol was used to inspect the PHP-WASM/Node bridge, draft the C and TypeScript implementation, diagnose build-order, Asyncify-stack, syscall-binding, and Zend by-reference issues, and add tests. Chris Huber reviewed the source and runtime evidence and remains responsible for the change.

AI assistance: OpenAI gpt-5.6-sol via OpenCode was used to review and implement the follow-up fixes and tests.

chubes4 added 2 commits August 1, 2026 17:13
AI assistance: OpenAI gpt-5.6-terra via OpenCode regenerated PHP-WASM artifacts and verified the DNS runtime matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node PHP.wasm DNS functions return hardcoded empty results

1 participant