I know this might be a little too long, you can completely discard this
but DO NOT read part of it and then make such grammarly incorrect and
baffling replies.

Maybe I did not clearly state what I was doing, I'll be verbose this
time.

I'd like to:
Connect to a random wifi or ethernet (you can't hard code its dns
server, this won't work) with dns poisoning.
Define a known domain list that is not poisoned.
Connect directly to the dhcp dns for those domains to minimize impact
on the local CDN.
For those domains that are not in this list, redirect it to another dns
server. EDNS is not that good at preserving local CDNs but it's still
better than getting bogus results.

I was using dnsmasq 2.85 to do all of this, until it is upgraded and no
longer works. I'm not quite sure if it is an unintentional feature on
the old version 2.85, in option.c there is a piece of clearly
intentional code to deal with the sharp inside something like
"server=/#/1.1.1.1"

if (strcmp(arg, "#") == 0)
  domain = "";

this also sets the SERV_HAS_DOMAIN server flag below.
I remember seeing the feature being discussed in the mailing list,
though the thread is not that easy to find.

I spent some more time digging into the code base, only to find out
that there is no "easy" way to implement this in the new version
because of the new sorting algorithm used for choosing servers, the
vastly changed server flags (SERV_HAS_DOMAIN, along with some other
flags, are removed) and the fact that server flags and query flags are
already full, idk if the upstream is willing to merge my changes if the
size of the flags are enarged.

Worst case I just replace dnsmasq with systemd-networkd, but before
that I'd like to know if there's still other ways to implement this.

Any help is appreciated.

Thanks
Jerry

On Tue, 2021-11-09 at 17:23 +0100, Matus UHLAR - fantomas via Dnsmasq-
discuss wrote:
> On 09.11.21 22:10, Jerry Xiao wrote:
> > I have 30k+ lines of rules like "server=/somehost.tld/#" in my
> > config.
> 
> holy sh...!
> 
> > What I need is to use the dhcp assigned dns server for those 30k+
> > domains and forward the others to 1.1.1.1.
> 
> define 1.1.1.1 as default, so everything will be forwarded to 1.1.1.1
> 
> forward all those 30k+ domains to DHCP assigned server.
> 
> server=/somehost.tld/192.168.1.1
> server=/google.com/192.168.1.1
> 
> so all those domains will be forwarded there.
> 
> > This is not possible with your config.
> 
> it is not possible with _your_ config.
> 


_______________________________________________
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