Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
October 1, 2022 00:51
August 3, 2022 10:47
April 28, 2016 17:51
March 1, 2019 11:53
March 21, 2022 16:54
October 8, 2019 23:55


Go Report Card GoDoc Release

Fast dns proxy that can run anywhere, built to black-hole internet advertisements and malware servers.

Based on kenshinx/godns and miekg/dns.


go install

You can also download one of the releases or docker images. Detailed guides and resources can be found on the wiki.

Docker Installation

To quickly get grimd up and running with docker, run

docker run -d -p 53:53/udp -p 53:53/tcp -p 8080:8080/tcp

Alternatively, download the docker-compose.yml file and launch it using docker-compose.

docker-compose up -d


If grimd.toml is not found, it will be generated for you, below is the default configuration.

# version this config was generated from
version = "1.0.9"

# list of sources to pull blocklists from, stores them in ./sources
sources = [

# list of locations to recursively read blocklists from (warning, every file found is assumed to be a hosts-file or domain list)
sourcedirs = [

# log configuration
# format: comma separated list of options, where options is one of 
#   file:<filename>@<loglevel>
#   stderr>@<loglevel>
#   syslog@<loglevel>
# loglevel: 0 = errors and important operations, 1 = dns queries, 2 = debug
# e.g. logconfig = "file:grimd.log@2,syslog@1,stderr@2"
logconfig = "file:grimd.log@2,stderr@2"

# apidebug enables the debug mode of the http api library
apidebug = false

# enable the web interface by default
dashboard = true

# address to bind to for the DNS server
bind = ""

# address to bind to for the API server
api = ""

# response to blocked queries with a NXDOMAIN
nxdomain = false

# ipv4 address to forward blocked queries to
nullroute = ""

# ipv6 address to forward blocked queries to
nullroutev6 = "0:0:0:0:0:0:0:0"

# nameservers to forward queries to
nameservers = ["", ""]

# concurrency interval for lookups in miliseconds
interval = 200

# query timeout for dns lookups in seconds
timeout = 5

# cache entry lifespan in seconds
expire = 600

# cache capacity, 0 for infinite
maxcount = 0

# question cache capacity, 0 for infinite but not recommended (this is used for storing logs)
questioncachecap = 5000

# manual blocklist entries
blocklist = []

# Drbl related settings
usedrbl = 0
drblpeersfilename = "drblpeers.yaml"
drblblockweight = 128
drbltimeout = 30
drbldebug = 0

# manual whitelist entries
whitelist = [

# manual custom dns entries
customdnsrecords = []

# When this string is queried, toggle grimd on and off
togglename = ""

# If not zero, the delay in seconds before grimd automaticall reactivates after
# having been turned off.
reactivationdelay = 300

#Dns over HTTPS provider to use.
DoH = ""


Requires golang 1.7 or higher, you build grimd like any other golang application, for example to build for linux x64

env GOOS=linux GOARCH=amd64 go build -v

Building Docker

Run container and test

mkdir sources
docker build -t grimd:latest -f docker/Dockerfile . && \
docker run -v $PWD/sources:/sources --rm -it -P --name grimd-test grimd:latest --config /sources/grimd.toml --update

By default, if the program runs in a docker, it will automatically replace in the default configuration with to ensure that the API interface is available.

curl -H "Accept: application/json"


A restful json api is exposed by default on the local interface, allowing you to build web applications that visualize requests, blocks and the cache. reaper is the default grimd web frontend.

If you want to enable the default dashboard, make sure the configuration file contains the following:

dashboard = true



Incoming requests spawn a goroutine and are served concurrently, and the block cache resides in-memory to allow for rapid lookups, while answered queries are cached allowing grimd to serve thousands of queries at once while maintaining a memory footprint of under 15mb for 100,000 blocked domains!


You can find examples of different daemon scripts for grimd on the wiki.


fast dns proxy that can run anywhere, built to black-hole internet advertisements and malware servers