dnsmasq: add support for filter-AAAA/A
authorChen Minqiang <ptpt52@gmail.com>
Mon, 7 Nov 2022 08:20:15 +0000 (16:20 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 12 Nov 2022 16:05:13 +0000 (17:05 +0100)
This add --filter-A and --filter-AAAA options, to remove IPv4 or IPv6
addresses from DNS answers. these options is supported since version 2.87.

Co-authored-by: NueXini <nuexini@alumni.tongji.edu.cn>
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
package/network/services/dnsmasq/files/dhcp.conf
package/network/services/dnsmasq/files/dnsmasq.init

index 8c42ef782e3b8f6f1a6393417a288be29d8428ad..4ddef172e63852851b803674b4b8a26bfe22903e 100644 (file)
@@ -21,6 +21,8 @@ config dnsmasq
        #list bogusnxdomain     '64.94.110.11'
        option localservice     1  # disable to allow DNS requests from non-local subnets
        option ednspacket_max   1232
+       option filter_aaaa      0
+       option filter_a         0
 
 config dhcp lan
        option interface        lan
index 386b47616e7f10a1961443d04e3acb4dc19074b0..21910f5fd19907248f3979ca837c31c39e049ae2 100755 (executable)
@@ -960,6 +960,9 @@ dnsmasq_start()
        append_bool "$cfg" rapidcommit "--dhcp-rapid-commit"
        append_bool "$cfg" scriptarp "--script-arp"
 
+       append_bool "$cfg" filter_aaaa "--filter-AAAA"
+       append_bool "$cfg" filter_a "--filter-A"
+
        append_parm "$cfg" logfacility "--log-facility"
        config_get logfacility "$cfg" "logfacility"
        append_parm "$cfg" cachesize "--cache-size"