shoenig / donutdns

Block ads, trackers, and malicious sites with donutdns - simple alternative to pihole. Run as a docker container, standalone executable or core DNS plugin. Supply custom domain block/allow lists in addition to builtin lists maintained by the ad-blocking community.
BSD 3-Clause "New" or "Revised" License
82 stars 6 forks source link

cli: enable running sub-commands #15

Closed shoenig closed 2 years ago

shoenig commented 2 years ago

Instead of merging https://github.com/shoenig/donutdns/pull/4 directly, it'd be nice to be able to incorporate such sub-tools into the donutdns binary itself - avoiding the large chunk of duplicate code.

As a first small command, I always wanted a way to check if a query would be blocked or not without going through the trouble of launching donutdns and using dig to send a query, etc.

Instead let us do something like

donutdns check <domain>

And the output would be something like one of

Blocked by default list exact match
Blocked by custom list exact match
Blocked by custom list suffix match
Allowed