Hi, Simon,

Yes, server=/#/<ip&gt; is not defined in the documentation, but it was indeed a 
valid configuration before the domain-search rewrite 
(https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=12a9aa7c628e2d7dcd34949603848a3fb53fce9c),
 and had a dedicated log output format:


$ src/dnsmasq -d -p 5353 -R -h -q -c 0 -S '1.1.1.1' -S '/#/8.8.8.8' -S '1.0.0.1'
dnsmasq: started, version 2.85-11-g50ccf9c cache disabled
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN 
DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-cryptohash no-DNSSEC 
loop-detect inotify dumpfile
dnsmasq: using nameserver 1.0.0.1#53
dnsmasq: using nameserver 8.8.8.8#53 for default &nbsp;
dnsmasq: using nameserver 1.1.1.1#53


Then you as the author, please don't tell me that you haven't seen the log in 
the format of "using nameserver <ip&gt;#<port&gt; for default".



But after the domain-search rewrite, it is no longer available and is not even 
compatible with the old configuration at all:



$ src/dnsmasq -d -p 5353 -R -h -q -c 0 -S '1.1.1.1' -S '/#/8.8.8.8' -S '1.0.0.1'
dnsmasq: started, version 2.87test9 cache disabled
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN 
DHCP DHCPv6 no-Lua TFTP no-conntrack ipset no-nftset auth no-cryptohash 
no-DNSSEC loop-detect inotify dumpfile
dnsmasq: using nameserver 1.1.1.1#53
dnsmasq: using nameserver 8.8.8.8#53 for domain # 
dnsmasq: using nameserver 1.0.0.1#53


dnsmasq no longer forwards any request to 8.8.8.8, unless the domain is #. 
Could you tell me what is "domain #"?


My patch is to get the "using nameserver <ip&gt;#<port&gt; for default" back.


Sincere greetings,
?????? (XIE Zhibang)







------------------&nbsp;Original&nbsp;------------------
From:                                                                           
                                             "Simon Kelley"                     
                                                               
<si...@thekelleys.org.uk&gt;;
Date:&nbsp;Mon, Aug 8, 2022 06:27 PM
To:&nbsp;"dnsmasq-discuss"<dnsmasq-discuss@lists.thekelleys.org.uk&gt;;

Subject:&nbsp;Re: [Dnsmasq-discuss] [PATCH] Fix --server=/#/...... which was 
lostin 2.86



I'm not sure what you are trying to do here.

the /#/ domain is only defined in the man page for --address and it 
states that it matches any domain which doesn't have a more specific match.

Even though,

server=/#/<ip&gt;

is not defined in the documentation; by extension it is exactly the same as

server=<ip&gt;


Which uses that server when a more specific domain doesn't match.



Please could you detail the configuration you are using, what the 
current behaviour is, and what behaviour you think it should have?


Cheers,

Simon.





On 23/07/2022 17:06, ??????(XIE Zhibang) via Dnsmasq-discuss wrote:
&gt;&nbsp; &gt; If the proposed change is related to commit 26bbf5a314d833bea 
say so.
&gt;&nbsp; &gt; (Yes, I'm asking for an even better commit message.)
&gt; I don't think the two are related, the only connection is that they are 
&gt; both victims.
&gt; 
&gt;&nbsp; &gt; Why the reshuffle?&nbsp; What about SERV_DEFAULT 65536 and 
avoiding the 
&gt; reshuffle?
&gt; Then the order will be default server, IPv6 literal, IPv4 literal, 
&gt; all-zero literal......
&gt; Just check the order_qsort() in domain-match.c.
&gt; 
&gt; ---Original---
&gt; *From:* "Geert Stappers via 
&gt; Dnsmasq-discuss"<dnsmasq-discuss@lists.thekelleys.org.uk&gt;
&gt; *Date:* Sat, Jul 23, 2022 23:08 PM
&gt; *To:* "dnsmasq-discuss"<dnsmasq-discuss@lists.thekelleys.org.uk&gt;;
&gt; *Subject:* Re: [Dnsmasq-discuss] [PATCH] Fix --server=/#/...... which 
&gt; was lostin 2.86
&gt; 
&gt; On Sat, Jul 23, 2022 at 02:02:31PM +0000, ?????? (XIE Zhibang) via 
&gt; Dnsmasq-discuss wrote:
&gt;&nbsp; &gt; A victim of the domain-search rewrite.
&gt;&nbsp; &gt; --server=/#/...... means to use the server for default. The new
&gt;&nbsp; &gt; implementation orders the default server first, but because of 
the
&gt;&nbsp; &gt; rewrote domain-search, it needs strict-order to ensure the 
default.
&gt; 
&gt; 
&gt; Much better as only the "git commit summary".
&gt; 
&gt; 
&gt; If the proposed change is related to commit 26bbf5a314d833bea say so.
&gt; (Yes, I'm asking for an even better commit message.)
&gt; 
&gt; 
&gt;&nbsp; &gt; Signed-off-by: ?????? (XIE Zhibang) <yek...@red54.com&gt;
&gt;&nbsp; &gt; ---
&gt;&nbsp; &gt;&nbsp; src/dnsmasq.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 34 
++++++++++++++++++----------------
&gt;&nbsp; &gt;&nbsp; src/domain-match.c | 15 +++++++++++----
&gt;&nbsp; &gt;&nbsp; src/network.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 2 +-
&gt;&nbsp; &gt;&nbsp; 3 files changed, 30 insertions(+), 21 deletions(-)
&gt;&nbsp; &gt;
&gt;&nbsp; &gt; diff --git a/src/dnsmasq.h b/src/dnsmasq.h
&gt;&nbsp; &gt; index a8937ce..7512756 100644
&gt;&nbsp; &gt; --- a/src/dnsmasq.h
&gt;&nbsp; &gt; +++ b/src/dnsmasq.h
&gt;&nbsp; &gt; @@ -534,23 +534,24 @@ union mysockaddr {
&gt;&nbsp; &gt;
&gt;&nbsp; &gt;
&gt;&nbsp; &gt;&nbsp; /* The actual values here matter, since we sort on them 
to get 
&gt; records in the order
&gt;&nbsp; &gt; -&nbsp;&nbsp; IPv6 addr, IPv4 addr, all zero return, resolvconf 
servers, 
&gt; upstream server, no-data return&nbsp; */
&gt;&nbsp; &gt; +&nbsp;&nbsp; IPv6 addr, IPv4 addr, all zero return, default 
server, resolvconf 
&gt; servers, upstream server, no-data return */
&gt;&nbsp; &gt;&nbsp; #define SERV_LITERAL_ADDRESS&nbsp;&nbsp;&nbsp; 1&nbsp; /* 
addr is the answer, or NoDATA 
&gt; is the answer, depending on the next four flags */
&gt;&nbsp; &gt;&nbsp; #define 
SERV_USE_RESOLV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp; /* 
forward this domain in the 
&gt; normal way */
&gt;&nbsp; &gt; -#define 
SERV_ALL_ZEROS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp; /* 
return all zeros for A and AAAA */
&gt;&nbsp; &gt; -#define 
SERV_4ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 8&nbsp; /* addr is IPv4 */
&gt;&nbsp; &gt; -#define 
SERV_6ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 16&nbsp; /* addr is IPv6 */
&gt;&nbsp; &gt; -#define 
SERV_HAS_SOURCE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32&nbsp; /* source 
address defined */
&gt;&nbsp; &gt; -#define 
SERV_FOR_NODOTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 64&nbsp; /* server 
for names with no 
&gt; domain part only */
&gt;&nbsp; &gt; -#define SERV_WARNED_RECURSIVE 128&nbsp; /* avoid warning spam 
*/
&gt;&nbsp; &gt; -#define 
SERV_FROM_DBUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 256&nbsp; /* 1 if 
source is DBus */
&gt;&nbsp; &gt; -#define 
SERV_MARK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 512&nbsp; /* for mark-and-delete and log 
&gt; code */
&gt;&nbsp; &gt; -#define 
SERV_WILDCARD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1024&nbsp; /* domain 
has leading '*' */
&gt;&nbsp; &gt; -#define SERV_FROM_RESOLV&nbsp;&nbsp;&nbsp;&nbsp; 2048&nbsp; /* 
1 for servers from resolv, 0 
&gt; for command line. */
&gt;&nbsp; &gt; -#define SERV_FROM_FILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
4096&nbsp; /* read from --servers-file */
&gt;&nbsp; &gt; -#define 
SERV_LOOP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
8192&nbsp; /* server causes forwarding loop */
&gt;&nbsp; &gt; -#define SERV_DO_DNSSEC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
16384&nbsp; /* Validate DNSSEC when using 
&gt; this server */
&gt;&nbsp; &gt; -#define SERV_GOT_TCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
32768&nbsp; /* Got some data from the TCP 
&gt; connection */
&gt;&nbsp; &gt; +#define 
SERV_DEFAULT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
4&nbsp; /* Use the server for default 
&gt; (need strict-order) */
&gt;&nbsp; &gt; +#define 
SERV_ALL_ZEROS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp; /* 
return all zeros for A and AAAA */
&gt;&nbsp; &gt; +#define 
SERV_4ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 16&nbsp; /* addr is IPv4 */
&gt;&nbsp; &gt; +#define 
SERV_6ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 32&nbsp; /* addr is IPv6 */
&gt;&nbsp; &gt; +#define 
SERV_HAS_SOURCE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 64&nbsp; /* source 
address defined */
&gt;&nbsp; &gt; +#define SERV_FOR_NODOTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
128&nbsp; /* server for names with no 
&gt; domain part only */
&gt;&nbsp; &gt; +#define SERV_WARNED_RECURSIVE 256&nbsp; /* avoid warning spam 
*/
&gt;&nbsp; &gt; +#define 
SERV_FROM_DBUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 512&nbsp; /* 1 if 
source is DBus */
&gt;&nbsp; &gt; +#define 
SERV_MARK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
1024&nbsp; /* for mark-and-delete and log 
&gt; code */
&gt;&nbsp; &gt; +#define 
SERV_WILDCARD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2048&nbsp; /* domain 
has leading '*' */
&gt;&nbsp; &gt; +#define SERV_FROM_RESOLV&nbsp;&nbsp;&nbsp;&nbsp; 4096&nbsp; /* 
1 for servers from resolv, 0 
&gt; for command line. */
&gt;&nbsp; &gt; +#define SERV_FROM_FILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
8192&nbsp; /* read from --servers-file */
&gt;&nbsp; &gt; +#define 
SERV_LOOP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
16384&nbsp; /* server causes forwarding loop */
&gt;&nbsp; &gt; +#define SERV_DO_DNSSEC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
32768&nbsp; /* Validate DNSSEC when using 
&gt; this server */
&gt;&nbsp; &gt; +#define SERV_GOT_TCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
65536&nbsp; /* Got some data from the TCP 
&gt; connection */
&gt; 
&gt; Why the reshuffle?&nbsp; What about SERV_DEFAULT 65536 and avoiding the 
&gt; reshuffle?
&gt; 
&gt; 
&gt; 
&gt; Regards
&gt; Geert Stappers
&gt; Fully aware that 2^16 does NOT fit in a 16-bit integer.
&gt; -- 
&gt; Silence is hard to parse
&gt; 
&gt; _______________________________________________
&gt; Dnsmasq-discuss mailing list
&gt; Dnsmasq-discuss@lists.thekelleys.org.uk
&gt; https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
&gt; 
&gt; _______________________________________________
&gt; Dnsmasq-discuss mailing list
&gt; Dnsmasq-discuss@lists.thekelleys.org.uk
&gt; https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to