Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/relekang/coredns-blocklist
This is a coredns plugin to return NXDOMAIN response for any domain on preloaded lists. It can be useful to block malware domains or trackers.
https://github.com/relekang/coredns-blocklist
adblocking coredns dns
Last synced: 25 days ago
JSON representation
This is a coredns plugin to return NXDOMAIN response for any domain on preloaded lists. It can be useful to block malware domains or trackers.
- Host: GitHub
- URL: https://github.com/relekang/coredns-blocklist
- Owner: relekang
- Created: 2020-11-13T18:21:46.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-31T08:00:37.000Z (7 months ago)
- Last Synced: 2024-06-04T17:09:26.956Z (6 months ago)
- Topics: adblocking, coredns, dns
- Language: Go
- Homepage:
- Size: 308 KB
- Stars: 32
- Watchers: 3
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-coredns - blocklist - return NXDOMAIN response for any domain on preloaded lists. It can be useful to block malware domains or trackers. (External Plguins)
README
# coredns-blocklist
This is a [coredns][] plugin to return NXDOMAIN response for any domain
on preloaded lists. It can be useful to block malware domains or trackers.## Usage
It is possible to use this plugin with both files from disk and fetch
files from http servers by passing an url. The file should contain one
domain on each line. There is an example file in the example folder.```
. {
log
prometheus# load from url
blocklist https://mirror1.malwaredomains.com/files/justdomains
# load from file, if the path is not absolute it will be relative to the Corefile
blocklist blocklist.txtforward . 1.1.1.1 1.0.0.1
}
```## Installation
There is multiple ways to add plugins in [coredns][], but no matter the
way you choose **the order matters**. The order sets the precedense of
the plugins when resolving queries. This means the blocklist plugin
should be before any plugins that would resolve the domains correctly.
Furthermore, the log plugin should be before this plugin to get proper
logging.### Using plugin.cfg file
Add the following to the plugin.cfg file in your clone of coredns and follow
the instructions from coredns.```
blocklist:github.com/relekang/coredns-blocklist
```### Using a go file to compile the bundle
See the [example/main.go](./example/main.go) for how to create a file that you
can compile to get coredns with this plugin. This file will work with the
coredns version defined in [go.mod](./go.mod).The example is bundled up with releases of on the [release page][] of this
repository. There it can be downloaded prebuilt for a bunch of environments.[coredns]: https://coredns.io
[release page]: https://github.com/relekang/coredns-blocklist/releases