luci-mod-network: DNS - support filtering A or AAAA records
authorHannu Nyman <hannu.nyman@iki.fi>
Sat, 12 Nov 2022 18:54:59 +0000 (20:54 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 3 Apr 2023 11:45:03 +0000 (13:45 +0200)
Support Dnsmasq 2.87-5 feature to filter DNS results:
* remove IPv6 AAAA records and return only IPv4 addresses
* remove IPv4 A records and return only IPv6 addresses

Especially the removal of IPv6 AAAA records can be useful with
ISPs that provide IPv6 address resolving but do not actually
offer IPv6 routing/connectivity.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 20b765c77b479d1265fd7770b285addceabae32e)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js

index 7778703bbacbef6fa45870efcf885ce74845f879..4e682d87b4ce700d8aff6eebee2eb484b014fb82 100644 (file)
@@ -456,6 +456,17 @@ return view.extend({
                        _('Avoid uselessly triggering dial-on-demand links (filters SRV/SOA records and names with underscores).') + '<br />' +
                        _('May prevent VoIP or other services from working.'));
 
+               o = s.taboption('advanced', form.Flag, 'filter_aaaa',
+                       _('Filter IPv6 AAAA records'),
+                       _('Remove IPv6 addresses from the results and only return IPv4 addresses.') + '<br />' +
+                       _('Can be useful if ISP has IPv6 nameservers but does not provide IPv6 routing.'));
+               o.optional = true;
+
+               o = s.taboption('advanced', form.Flag, 'filter_a',
+                       _('Filter IPv4 A records'),
+                       _('Remove IPv4 addresses from the results and only return IPv6 addresses.'));
+               o.optional = true;
+
                s.taboption('advanced', form.Flag, 'localise_queries',
                        _('Localise queries'),
                        _('Return answers to DNS queries matching the subnet from which the query was received if multiple IPs are available.'));