uklans/cache-domains

FYI: dnsmasq 2.86 already support wildcard domains

electrofloat opened this issue · 2 comments

The script here: https://github.com/uklans/cache-domains/blob/master/scripts/create-dnsmasq.sh#L53
is removing *. from the domains, but dnsmasq version > 2.86 already supports wildcard domains:
imp/dnsmasq@5e95c16
(although this is a mirror repo, the commit is in the original repo too, and in the released dnsmasq)

So it would be nice if the script could generate the wildcard domains too if it is supported.

I believe you have misunderstood the commentary within the commit you linked from dnsmasq.

Domain patterns in --address, --server and --local have, for many years, matched complete labels only, so
--server=/google.com/1.2.3.4 will apply to google.com and www.google.com but NOT supergoogle.com

This commit introduces an optional '*' at the LHS of the domain string which changes this behaviour so as to include substring matches within labels. So, --server=/*google.com/1.2.3.4 applies to google.com, www.google.com AND supergoogle.com.

This means the syntax in the Dnsmasq script currently DOES handle wildcards, in fact, it always has from inception. The script was changed recently to support multi-IP LANCache setups which had to do with dnsmasq's support for multiple IP addresses in the address= syntax.

@VibroAxe I believe this can be closed off.

Agreed, thanks for the clarification @nightah