Sign inSign up

sievelau/mosdns

By sievelau

•Updated 10 months ago

A DNS forwarder.

Image
Networking
0

1.2K

sievelau/mosdns repository overview

⁠Configuration

The image is quite straight-forward. It runs my fork of mosdns⁠ which is a fork of the v4 version of upstream IrineSistiana/mosdns⁠, with commandline parameters -d /config -c config.yaml. So when the container starts, it will search for a config file named config.yaml under /config. About how to configure mosdns, please refer to its docs: https://irine-sistiana.gitbook.io/mosdns-wiki/⁠.

⁠Usage

Mount the config directory to /config and it will work. Please name the config file to config.yaml, because I'm new to docker and don't know how to allow user to customize this.

For example, for testing the config file:

sudo docker run -it --rm -v /etc/mosdns:/config:ro sievelau/mosdns

If the config is good, it will run without errors. If you set the log level for mosdns to info, there will be logs which tell it is listening on the port you wish and that's the sign of a good config.

For a more convicing config test, you can map the ports. Be aware of the protocol declaration, since if no protocol is given docker will use tcp.

sudo docker run -it --rm -v /etc/mosdns:/config:ro -p 53:53/udp sievelau/mosdns

Then you can use tools like dig and ping to test if it is working as expected.

For auto restart on boot, just add the command line parameter --restart to docker run:

sudo docker run -it --restart always -v /etc/mosdns:/config:ro -p 53:53/udp sievelau/mosdns

⁠How to Update

  1. Stop and remove the container:
# use this to search for your mosdns container ID
sudo docker ps
sudo docker stop <container_ID>
sudo docker rm <container_ID>
  1. Pull new image and start again. Replace <your_options> with the same options you used to run the container before.
sudo docker pull sievelau/mosdns
sudo docker run <your_options>

Tag summary

Content type

Image

Digest

sha256:17916b199…

Size

18.7 MB

Last updated

10 months ago

docker pull sievelau/mosdns