Wildcard whitelisting via server command in an additional dnsmasq config

I added an additional conf file in /etc/dnsmasq.d and added whitelisted (sub)domains as follows:

server=/subdomain/#

As stated in the manpage of dnsmasq (e.g. http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html) this gives an expected behaviour of whitelisting, even if there is blacklisting stated for the domain.

I see no negative effect, but only the log-entry for a request is not marked as whitelisted, but this behaviour could be obtained via software (matching).

Is it possible, that whitelisting will be reflected via the stated server command, or is there any reason why this should not be implemented?

Thanks, I will investigate on this.

maybe another standard wildcard config file might be appropriate, e.g.

/etc/dnsmasq.d/04-pihole-whitelist-wildcard.conf

and the context of the wildcards in blacklisting could be respecte in the filenames, e.g.

/etc/dnsmasq.d/03-pihole-wildcard.conf --> /etc/dnsmasq.d/03-pihole-blacklist-wildcard.conf

as stated in the man page:

--servers-file=<file>
A special case of --conf-file which differs in two respects. Firstly, only --server and --rev-server are allowed in the configuration file included. Secondly, the file is re-read and the configuration therein is updated when dnsmasq receives SIGHUP.

the new conf file should be placed in this parameter to enable dnsmasq to be updated via receiving SIGHUP instead of the service neeed to be restarted.

as quick implemention... just copy modify the blacklist webinterface import and set it up for whitelists too so as users can set a whitelist up in webinterface and it is parsed by push a update button

ah, okay.

from my point all features that are implemented for blacklists, could be migrated for the whitelisting context.

as permises (for the gravity script to condense all lists) we have:

  • hostlist entries should be created last (as dnsmasq gives them top prio for requests)
  • wildcarded whitelist (super)-domain should drive the removal of contradicting host entries (plain blacklist (sub)-domains)
  • dnsmasq uses the most specific adress/server entry to decide "routing" of domain-queries: this seems to be a sufficient rule to create reasonable wildcard statements for both, blacklist and whitelist.

i hope to here feedback of the creator of the gravity engine to this statements...
maybe i am missing an important point.

@jacob.salmela :this:

Addling a domain to wildcard whitlist is implemented.
Bildschirmfoto zu 2020-06-05 21-00-38