You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pi-hole version is v5.18.2 (Latest: v5.18.2)
web version is v5.21 (Latest: v5.21)
FTL version is v5.25.2 (Latest: v5.25.2)
Platform
OS and version: Ubuntu 23.10
Platform: x64 VM
Expected behavior
When adding entries to /etc/pihole/custom.list via editing the file (bypassing the Web UI) and specifying a row separated by more than one space, the Web UI should show them, parsing the file as you would /etc/hosts as that's what dnsmasq does.
Actual behavior / bug
Rows that don't exactly fit <IP><space><DNS> won't show.
Go to /admin/dns_records.php and observe that the second row is missing from the table. If reloading pihole-FTL, note that it will still resolve, but it won't show up here.
Because it splits on a single space, it does not handle this edge case.
Additional context
It could be argued that this is not a problem as users aren't supposed to write this file directly. However, it would be nice to support this use case. In my case, I manage this file via Ansible and to make it easier to read I have aligned it to look like a table:
192.168.1.1 second
192.168.1.10 first
You might not consider this a bug so feel free to label it as a feature request (if you consider it nice to have) or close it (if you explicitly don't want to support this).
If you did want to fix this, full-fledged parsing of /etc/hosts would probably be ideal, so that e.g. comments won't trip it up. A simpler implementation could just be handling multiple white space between the two "columns"
The text was updated successfully, but these errors were encountered:
This is fixed in the current beta v6.0 as handing custom DNS records moved into /etc/pihole/pihole.toml with specified syntax. It'd be great if you could test if migrating with your particular file works as expected.
Thanks for the quick reply @DL6ER! I've just set up one of my nodes to use v6 and you're right: This now works, if I add multiple spaces it handles it correctly!
Versions
Pi-hole version is v5.18.2 (Latest: v5.18.2)
web version is v5.21 (Latest: v5.21)
FTL version is v5.25.2 (Latest: v5.25.2)
Platform
Expected behavior
When adding entries to
/etc/pihole/custom.list
via editing the file (bypassing the Web UI) and specifying a row separated by more than one space, the Web UI should show them, parsing the file as you would/etc/hosts
as that's what dnsmasq does.Actual behavior / bug
Rows that don't exactly fit
<IP><space><DNS>
won't show.Steps to reproduce
Steps to reproduce the behavior:
Put this in
/etc/pihole/custom.list
:Go to
/admin/dns_records.php
and observe that the second row is missing from the table. If reloading pihole-FTL, note that it will still resolve, but it won't show up here.The corresponding line is here: https://github.com/pi-hole/web/blob/master/scripts/pi-hole/php/func.php#L205
Because it splits on a single space, it does not handle this edge case.
Additional context
It could be argued that this is not a problem as users aren't supposed to write this file directly. However, it would be nice to support this use case. In my case, I manage this file via Ansible and to make it easier to read I have aligned it to look like a table:
You might not consider this a bug so feel free to label it as a feature request (if you consider it nice to have) or close it (if you explicitly don't want to support this).
If you did want to fix this, full-fledged parsing of
/etc/hosts
would probably be ideal, so that e.g. comments won't trip it up. A simpler implementation could just be handling multiple white space between the two "columns"The text was updated successfully, but these errors were encountered: