Skip to content

Add DNS testing setup using BIND 9 - #18693

Draft
bukka wants to merge 1 commit into
php:PHP-8.4from
bukka:dns-test
Draft

bukka wants to merge 1 commit into
php:PHP-8.4from
bukka:dns-test

Conversation

@bukka

@bukka bukka commented May 28, 2025 •

Copy link
Copy Markdown
Member

This creates a test framework for testing PHP DNS functions that are currently completely untested. It provides scripts for starting a BIND 9 DNS server that serves locally defined zone files. Those can then be used for creating specific test scenarios without a need to rely on online data. This is all used in the GitHub Actions Linux jobs.

The PHP DNS functions use libresolv which reads /etc/resolv.conf directly, so resolv-setup.sh replaces that file with one pointing to the local BIND server (keeping the previous nameservers as a fallback) instead of configuring systemd-resolved, which re-applies DHCP servers and routes queries per link and therefore did not work reliably in CI. BIND forwards all other queries to the original upstream nameservers so the rest of the system keeps resolving. See ext/standard/tests/dns/README.md for local usage.

The target branch is set to PHP-8.4 because this is meant to be used for testing of bug fixes.

@bukka

bukka commented May 28, 2025

Copy link
Copy Markdown
Member Author

This is a draft for now as it will require most likely more work to make it work in pipeline. It works locally for me but I'm not expecting CI to work the same...

@bukka
bukka force-pushed the dns-test branch 8 times, most recently from d371d31 to c74de14 Compare June 23, 2025 15:38
@bukka
bukka force-pushed the dns-test branch 3 times, most recently from 7b35d37 to 897932f Compare July 18, 2025 16:18
@bukka
bukka force-pushed the dns-test branch 4 times, most recently from 2cf5f75 to e0b8cf0 Compare July 28, 2025 14:52
@bukka
bukka force-pushed the dns-test branch 3 times, most recently from 10f828d to 6038793 Compare September 3, 2025 13:49
@bukka
bukka changed the base branch from PHP-8.3 to PHP-8.4 October 8, 2026 17:56
This creates a test framework for testing PHP DNS functions that were
previously completely untested. It provides scripts for starting a BIND 9
server that serves locally defined zone files, which can be used for
creating specific test scenarios without the need to rely on online data.

The PHP DNS functions use libresolv which reads /etc/resolv.conf, so the
resolv-setup.sh script replaces that file with one pointing to the local
BIND server (keeping the previous nameservers as a fallback) instead of
configuring systemd-resolved, which re-applies DHCP servers and routes
queries per link and therefore did not work reliably in CI. BIND forwards
all other queries to the original upstream nameservers so the rest of the
system keeps resolving. This is all used in the GitHub Actions Linux jobs.
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.

1 participant