Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@DL6ER
Copy link
Member

@DL6ER DL6ER commented Jul 25, 2025

What does this implement/fix?

This PR improves the behavior of the special hostname pi.hole when encountered throughout deep CNAME inspection. This ensures that any defined custom CNAME rules that eventually end up in pi.hole get the correct interface-dependent IP addresses both for IPv4 (A) and IPv6 (AAAA).


Related issue or feature (if applicable): Fixes #2581

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories development branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

@DL6ER DL6ER requested a review from a team as a code owner July 25, 2025 17:44
@DL6ER DL6ER requested review from Copilot and removed request for a team July 25, 2025 17:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the handling of the special hostname pi.hole within CNAME resolution chains to ensure proper interface-dependent IP address resolution for both IPv4 and IPv6 queries.

  • Adds logic to detect when pi.hole appears in CNAME chains and updates cache records with current interface addresses
  • Enhances dnsmasq configuration to include both IPv4 and IPv6 host records for pi.hole
  • Adds comprehensive test coverage for CNAME chain behavior with pi.hole

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/dnsmasq_interface.c Implements cache record updating logic for pi.hole in CNAME chains
src/config/dnsmasq_config.c Updates host record configuration to include IPv6 address
test/pihole.toml Adds test CNAME record and resets custom IP configurations
test/test_suite.bats Adds test cases for CNAME chain behavior and updates expected config count

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Dominik <[email protected]>
@yubiuser yubiuser linked an issue Jul 26, 2025 that may be closed by this pull request
@DL6ER DL6ER merged commit e5afc91 into development Jul 26, 2025
18 checks passed
@DL6ER DL6ER deleted the tweak/cname_pihole_pointer branch July 26, 2025 17:32
@PromoFaux PromoFaux mentioned this pull request Oct 25, 2025
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.

CNAME records pointing to pi.hole return 0.0.0.0

3 participants