Skip to content
Alexander Kubintsev edited this page Nov 2, 2025 · 5 revisions

Example usage for Keenetic running 4.3

  1. You have to init your keenetic router with OPKG as described in official docs.
  2. After that go to shell and create folder for dns-proxy mkdir -p /opt/home/dns-proxy
  3. Upload dns-proxy binary corresponding for your router cpu arch (mipsle or modern aarch64) to that folder /opt/home/dns-proxy with Keenetic Web GUI (look into Application storage)
  4. Now go back to shell. Edit new file for init.d autostart service /opt/etc/init.d/S99dnsproxy
#!/bin/sh

ENABLED=yes
PROCS=dns-proxy-linux-arm64
PIDFILE="/opt/var/run/dns-proxy.pid"
ARGS="--log=syslog --config /opt/home/dns-proxy/config.yaml --pid $PIDFILE"
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/home/dns-proxy

# for go performance tuning
GOMAXPROCS=2

. /opt/etc/init.d/rc.func

You can optionally modify there env GOMAXPROCS to specify max amount of threads.

  1. Then make the file executable: chmod +x /opt/etc/init.d/S99dnsproxy

  2. Let's configure dns-proxy with editing /opt/home/dns-proxy/config.yaml

listen: "0.0.0.0:53"

# read timeout
read_deadline: 2s

# options for primary destination dns server
primary:
  host: "192.168.0.100:53"
  down_ttl: "5m"        # period to use fallback server when primary is down
  failure_threshold: 3  # consecutive failures before marking primary down

# list of fallback dns servers to use when primary is down
fallback:
  - host: "85.21.192.5:53"
    initial_rtt: "20ms"
  - host: "213.234.192.7:53"
    initial_rtt: "20ms"
  - host: "78.88.8.8:53"
    initial_rtt: "30ms"

scoring:
  initial_rtt: "50ms"
  penalty: 25          # milliseconds added on failure
  decay: 0.9           # exponential decay coefficient (0.0–1.0)
  min_rtt: "5ms"       # lower clamp
  max_rtt: "900ms"     # upper clamp

Basic explanation:

  • listen - network interface and port to serve
  • down_ttl - amount of time to skip primary DNS destination server after failure while sending requests to secondary DNS servers
  • fallback - list of servers to proxy dns requests while primary one is considered as failed and down.
  1. Try to start service: /opt/etc/init.d/S99dnsproxy start

Clone this wiki locally