Skip to content

Add dns.hostsLocal to the Local DNS settings page - #3858

Open
DL6ER wants to merge 2 commits into
developmentfrom
new/hosts_local
Open

Add dns.hostsLocal to the Local DNS settings page#3858
DL6ER wants to merge 2 commits into
developmentfrom
new/hosts_local

Conversation

@DL6ER

@DL6ER DL6ER commented Aug 23, 2026

Copy link
Copy Markdown
Member

What does this PR aim to accomplish?:

pi-hole/FTL#3037 adds dns.hostsLocal, which decides whether the names in dns.hosts are kept local. It has no representation in the web interface yet, and the page that manages those records is where it belongs.

How does this PR accomplish the above?:

A checkbox below the local DNS record table, stored with the usual "Save & Apply" button - the page had none so far, because both tables apply their changes immediately.

Needs FTL #3037 to be merged first, otherwise the page asks for a config key that does not exist.

Link documentation PRs if any are needed to support this PR:

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 and I have tested my changes.
  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)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

The new FTL setting decides whether the names in `dns.hosts` are kept local, so it belongs next to the records it applies to rather than on the general DNS page. The checkbox sits below the record table and is saved with the usual "Save & Apply" button, which the page did not have so far because both tables apply their changes immediately.

Signed-off-by: DL6ER <dl6er@dl6er.de>
Copilot AI lite review requested due to automatic review settings August 23, 2026 08:32
@DL6ER
DL6ER requested a review from a team as a code owner August 23, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a dns.hostsLocal checkbox to the Local DNS settings page.

Changes:

  • Adds explanatory UI and Save & Apply support.
  • Loads and saves the setting through the FTL API.
  • Updates restart messaging.

Reviewed changes

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

File Summary
settings-dnsrecords.lp Adds the setting UI and save control. Preserve the disabled state for environment-controlled settings when controls are re-enabled.
scripts/js/settings-dns-records.js Loads the dns.hostsLocal configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread settings-dnsrecords.lp
<div class="row">
<div class="col-md-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="dns.hostsLocal" data-key="dns.hostsLocal">
The `local=` lines that `dns.hostsLocal` generates are part of the dnsmasq configuration, which is read at startup only. The note claimed the opposite.

Signed-off-by: DL6ER <dl6er@dl6er.de>
codeXe098
codeXe098 previously approved these changes Aug 24, 2026
@rdwebdesign
rdwebdesign dismissed codeXe098’s stale review August 24, 2026 20:30

Not a team member

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.

3 participants