We aren't privy to the scenarios you are working on, but I think it's achievable in some way. Once you hit Apply in the UI, your changes are written to custom_settings.txt. They are available to both the main diversion script and dnsmasq.postconf. Can they both read the same custom_settings.txt and can't dnsmasq.postconf modify dnsmasq.conf accordingly, assuming that diversion will complete its processing without fail? Could you not SIGHUP dnsmasq within Diversion instead of restarting it if Diversion updates a blocking list (for example)?