lixingcong / dnsmasq-regex

dnsmasq with regex match module(libpcre v8.45, the older version)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compile option ok?

indexofrefraction opened this issue · comments

Hi,
I'm following the compile instructions exactly,
but on ./dnsmasq/src/dnsmasq --version i get :

Dnsmasq version 2.89-44-g9bbf098 Copyright (c) 2000-2023 Simon Kelley
Compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n regex no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack no-ipset no-nftset auth no-cryptohash no-DNSSEC loop-detect no-inotify dumpfile

the compile options contain "regex" but not "regex(+ipset,nftset)"
is this because of "no-ipset no-nftset" coming from the main repo ?

Can't reproduce

this is on macOS and I was not 100% sure if the build is correct.
i tried your test scripts... that looks ok, right?

cd dnsmasq-regex
./dnsmasq/src/dnsmasq -d -C test/whitelist_test.conf -q &
bash test/whitelist_test.sh

UDP, server
jd.com is forwared to 0.0.0.0
dnsmasq: query[A] jd.com from ::1
dnsmasq: config jd.com is 0.0.0.0
www.fb.me is forwared to 0.0.0.0
dnsmasq: query[A] www.fb.me from ::1
dnsmasq: config www.fb.me is 0.0.0.0
educause.edu is forwared to 114.114.114.114
dnsmasq: query[A] educause.edu from ::1
dnsmasq: cached educause.edu is 104.20.34.250
dnsmasq: cached educause.edu is 172.67.17.122
dnsmasq: cached educause.edu is 104.20.33.250
www.msn.com is forwared to 1.1.1.1
dnsmasq: query[A] www.msn.com from ::1
dnsmasq: cached www.msn.com is
dnsmasq: cached www-msn-com.a-0003.a-msedge.net is
dnsmasq: cached a-0003.a-msedge.net is 204.79.197.203
msn.com is forwared to 0.0.0.0
dnsmasq: query[A] msn.com from ::1
dnsmasq: config msn.com is 0.0.0.0
www.google.com is forwared to 114.114.114.114
dnsmasq: query[A] www.google.com from ::1
dnsmasq: cached www.google.com is 142.251.4.104
dnsmasq: cached www.google.com is 142.251.4.106
dnsmasq: cached www.google.com is 142.251.4.105
dnsmasq: cached www.google.com is 142.251.4.99
dnsmasq: cached www.google.com is 142.251.4.147
dnsmasq: cached www.google.com is 142.251.4.103
google.com is forwared to 0.0.0.0
dnsmasq: query[A] google.com from ::1
dnsmasq: config google.com is 0.0.0.0
TCP, server
www.jd.com is forwared to 0.0.0.0
dnsmasq: query[A] www.jd.com from ::1
dnsmasq: config www.jd.com is 0.0.0.0
api.github.com is forwared to 0.0.0.0
dnsmasq: query[A] api.github.com from ::1
dnsmasq: config api.github.com is 0.0.0.0
berkeley.edu is forwared to 114.114.114.114
dnsmasq: query[A] berkeley.edu from ::1
dnsmasq: cached berkeley.edu is 141.193.213.20
dnsmasq: cached berkeley.edu is 141.193.213.21
msnbc.msn.com is forwared to 1.1.1.1
dnsmasq: query[A] msnbc.msn.com from ::1
dnsmasq: cached msnbc.msn.com is
dnsmasq: cached www-msn-com.a-0003.a-msedge.net is
dnsmasq: cached a-0003.a-msedge.net is 204.79.197.203
msn.cn is forwared to 0.0.0.0
dnsmasq: query[A] msn.cn from ::1
dnsmasq: config msn.cn is 0.0.0.0
play.google.com is forwared to 114.114.114.114
dnsmasq: query[A] play.google.com from ::1
dnsmasq: forwarded play.google.com to 114.114.114.114
dnsmasq: reply play.google.com is 142.251.166.100
dnsmasq: reply play.google.com is 142.251.166.101
dnsmasq: reply play.google.com is 142.251.166.138
dnsmasq: reply play.google.com is 142.251.166.139
dnsmasq: reply play.google.com is 142.251.166.102
dnsmasq: reply play.google.com is 142.251.166.113
google.cn is forwared to 0.0.0.0
dnsmasq: query[A] google.cn from ::1
dnsmasq: config google.cn is 0.0.0.0

I have no macOS and can not reproduce.

As you said, there are no-ipset and no-nfset in your compile time flags.

Compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n regex no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack no-ipset no-nftset auth no-cryptohash no-DNSSEC loop-detect no-inotify dumpfile

You can try to build original version of dnsmasq and make the flags no-ipset and no-nfset disappear.

Make sure your system support ipset and nftset, and edit DNSMASQ_COPTS in Makefile of this repo to build again.

FreeBSD does not seem to support nftset. Perhaps that's why regex forwarding does not seem to work properly.