Sign inSign up

oneevil/dns-server

By oneevil

Updated over 1 year ago

DNS server on MikroTik

Image
Networking
1

1.3K

oneevil/dns-server repository overview

Install DNS server on MikroTik

/interface bridge
add name=bridge-docker
/interface veth
add address=172.20.0.3/24,172.20.0.4/24 gateway=172.20.0.1 gateway6="" name=veth2-dns
/interface list member
add interface=veth2-dns list=LAN
/interface bridge port
add bridge=bridge-docker interface=veth2-dns
/ip address
add address=172.20.0.1/24 interface=bridge-docker network=172.20.0.0
/container envs
add key=UPSTREAM name=dns value=dns.google
add key=UPSTREAM_IP name=dns value=8.8.8.8
add key=BIRD name=dns value=172.20.0.2
add key=FALLBACK_UPSTEAM name=dns value=1
add key=SECOND_TUNNEL name=dns value=1
add key=ROUTE name=dns value=192.168.50.1
add key=ROUTE_SECOND name=dns value=192.168.60.1
add key=TTL name=dns value=720h
/container mounts
add dst=/data name=storage src=/storage
/container
add envlist=dns remote-image=oneevil/dns-server:latest interface=veth2-dns logging=yes \
    mounts=storage root-dir=containers/dns start-on-boot=yes workdir=/
/ip dns
set servers=172.20.0.3

Network Configuration Parameters

add address=172.20.0.3/24,172.20.0.4/24 gateway=172.20.0.1 gateway6="" name=veth2-dns

The IP addresses assigned to the interface (comma-separated). Multiple IP addresses are required if multiple routes are configured. This allows different next-hop addresses to be set for each list of domains.

Note: Multiple IP addresses are needed for configuring multiple next-hop addresses for different domain lists when using multiple routes.

DNS Configuration Parameters

Below are the key-value pairs used to configure the DNS container:

KeyValue ExampleDescription
UPSTREAMdns.googleThe domain name of the upstream DNS provider (optional).
UPSTREAM_IP8.8.8.8The IP address of the upstream DNS provider (optional).
BIRD172.20.0.2IP address used for the BGP routing daemon (bgp-server).
FALLBACK_UPSTEAM1Enables fallback to secondary upstream DNS (1 = enabled).
SECOND_TUNNEL1Enables second tunnel interface (1 = enabled).
ROUTE192.168.50.1The IP address of the gateway used for routing.
ROUTE_SECOND192.168.60.1Secondary gateway IP for routing (used if multiple routes are configured).
TTL720hStorage time of the route received through the domain name (optional).

Note: Parameters marked as optional can be omitted if you are using a single route.

Container Mounts

The container includes the following mount configuration:

add dst=/data name=storage src=/storage

This mount point (/data) contains two files:

  • domains.txt
  • domains_second.txt
Example Domains File (.txt)
example.com
example1.com

Applying Changes to DNS Routes

  1. Restart the container:
    • You can restart the container to apply the changes.

Tag summary

Content type

Image

Digest

sha256:e5ad5d70b

Size

16.7 MB

Last updated

over 1 year ago

docker pull oneevil/dns-server