Skip to content

Add warning to the multiple DNS advertisement #3571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

wsw70
Copy link

@wsw70 wsw70 commented Jul 20, 2025

Quick workaround for pi-hole/pi-hole#6360 for details.

Signed-off-by: wsw70 [email protected]

What does this PR aim to accomplish?:

Update the UI Advertise DNS server multiple times description to account for pi-hole/pi-hole#6360

How does this PR accomplish the above?:

By adding to the description

(...) This is not compatible with adding dhcp-option=6,... in dnsmasq_lines in /etc/pihole/config.toml or /etc/dnsmasq.d/

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

Quick workaround for pi-hole/pi-hole#6360 for details.

Signed-off-by: wsw70 <[email protected]>
@wsw70 wsw70 requested a review from a team as a code owner July 20, 2025 18:48
@@ -116,7 +116,7 @@ mg.include('scripts/lua/settings_header.lp','r')
<div class="col-sm-12">
<div>
<input type="checkbox" id="dhcp.multiDNS" data-key="dhcp.multiDNS" class="DHCPgroup">&nbsp;<label for="dhcp.multiDNS"><strong>Advertise DNS server multiple times</strong></label>
<p class="help-block">Advertise DNS server multiple times to clients. Some devices will add their own proprietary DNS servers to the list of DNS servers, which can cause issues with Pi-hole. This option will advertise the Pi-hole DNS server multiple times to clients, which should prevent this from happening.</p>
<p class="help-block">Advertise DNS server multiple times to clients. Some devices will add their own proprietary DNS servers to the list of DNS servers, which can cause issues with Pi-hole. This option will advertise the Pi-hole DNS server multiple times to clients, which should prevent this from happening. This is not compatible with adding dhcp-option=6,... in dnsmasq_lines in /etc/pihole/config.toml or /etc/dnsmasq.d/</p>
Copy link
Member

Choose a reason for hiding this comment

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

A few format suggestions:

Suggested change
<p class="help-block">Advertise DNS server multiple times to clients. Some devices will add their own proprietary DNS servers to the list of DNS servers, which can cause issues with Pi-hole. This option will advertise the Pi-hole DNS server multiple times to clients, which should prevent this from happening. This is not compatible with adding dhcp-option=6,... in dnsmasq_lines in /etc/pihole/config.toml or /etc/dnsmasq.d/</p>
<p class="help-block">Advertise DNS server multiple times to clients. Some devices will add their own proprietary DNS servers to the list of DNS servers, which can cause issues with Pi-hole. This option will advertise the Pi-hole DNS server multiple times to clients, which should prevent this from happening.<br>This is not compatible with adding <code>dhcp-option=6,...</code> in <code>dnsmasq_lines</code> in <em>/etc/pihole/config.toml</em> or <em>/etc/dnsmasq.d/</em></p>

@rrobgill
Copy link
Contributor

rrobgill commented Jul 20, 2025

Isn't this really kind of covered by the present warning ?

Warning: This is an advanced setting and should only be used with care. 
Incorrectly formatted or duplicated lines as well as lines conflicting with
the automatic configuration of Pi-hole can break the embedded dnsmasq
and will stop DNS resolution from working.

There are other options that can be changed in the UI (or directly editing pihole.toml) that are incompatible with adding the same option again in misc.dnsmasq_lines (or indeed by enabling misc.etc_dnsmasq_d and duplicating them in there).

A quick look at pihole.toml suggests port, cache-size, use-stale-cache, local-service, log-facility. And considering other options that are not enabled by default, probably most of the options under [dhcp].

If they all had additional warnings listed at the level of their option, the UI would get awfully cluttered. (As would all of the additional text in misc.dnsmasq_lines).

@yubiuser
Copy link
Member

I agree with @rrobgill. We can't warn about each possible incompatible option with whatever users might set in dnsmasq_lines. If they are so advanced that they need to set specific dnsmasq options, they should be able to check the logs and figure out what is conflicting here.

@wsw70
Copy link
Author

wsw70 commented Jul 21, 2025

I understand that everything cannot be warned against. In that case however the warning in the ligs points to a problem nowhere to be find in the config file - one needs to check dnsmasq.conf (a generated file) to realize where the warning comes from.

Adding extra DNS servers is also something not that exotic (though less likely with Pi-hole).

I am fine with closing the PR since there are now 2:0 comments stating this is not a good idea.

@wsw70 wsw70 closed this Jul 21, 2025
@DL6ER
Copy link
Member

DL6ER commented Jul 21, 2025

Plus, ideally, you should not even be able to configure your Pi-hole in a way that breaks the dnsmasq at least not from the UI/API/CLI as there is a config test involved in the process.

Example: Trying to set port=1234 in misc.dnsmasq_lines causes
Screenshot From 2025-07-21 19-03-27
and the new settings are not actually getting saved.

Only when directly working with pihole.toml there is nothing that could be done.

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.

5 participants