In this article
In order to run the Docker relay, you will first need to install Docker and Docker Compose on your machine. Docker is the container hypervisor and Docker Compose allows you to describe the environment for the relay container and easily bring it online.
Recommended specs: 64-bit 2-core CPU; 2GB of RAM.
Docker versions
Docker Desktop versions can be found below:
Set up steps
- After you have everything installed, create a new folder and put the following 2 files inside:
relay.conf
[log] #level = "error" level = "debug" verbose = true [client] name = "Skynet" secret_key = "YOURNETWORKSECRETKEY" # Local DNS servers to forward domain specific requests [[local_dns_server]] addresses = [ "192.168.2.3:53" ] local_domains = [ "lan", "mycompanydomain.com" ]
Make sure to specify your secret key in the value above for your network. You can also specify local DNS servers and domains which should be sent to those servers. Whenever the relay received a query for these domains, it will send the query to the specified servers.
docker-compose.yml
version: '3' services: relay: image: dnsfilter/relay:latest network_mode: host volumes: - ./relay.conf:/go/bin/relay.conf - ./relay.reg:/go/bin/relay.reg restart: unless-stopped
This file defines that Docker should download the
dnsfilter/relay:latest
image from Docker Hub, should bind to the networks of the host machine, and use therelay.conf
file in the folder, and restart if stopped. -
Create an empty file with the name below
relay.reg
The file above can be empty, it just needs to exist. Once the container runs, it will populate this file with the registration information for the relay, so that it persists. Without this file, every time you start and stop the relay, it would create a new copy in the DNSFilter dashboard. -
Next, open a terminal window and make sure you are in the same folder as the files. Start the relay container with this command:
docker-compose up -d && docker-compose logs -f
The container will start up and you will see log output.
-
At this point, you can set the IP address of the machine running this container as the DNS for another machine on your network. The queries from that machine should immediately be visible in the log output.
-
Go to the DNSFilter dashboard and start to see in the Query Log that DNS queries associated with this relay have started to come in.
-
To shut down the container, run:
docker-compose down
Comments
0 comments
Article is closed for comments.