lazydns

Forward Plugin

The forward plugin forwards DNS queries to upstream resolvers. It supports multiple upstreams, load-balancing strategies, failover, optional health checks, and DNS-over-HTTPS (DoH).

Key features

Behavior details

Configuration options

The plugin accepts an args map with the following keys:

Example configurations

Basic forwarder with two UDP upstreams:

plugins:
  - tag: forward
    type: forward
    args:
      upstreams:
        - "8.8.8.8:53"
        - "1.1.1.1:53|cloudflare"
      timeout: 5
      strategy: round_robin
      health_checks: true
      max_attempts: 3

Using DoH and fastest strategy:

plugins:
  - tag: forward_secure
    type: forward
    args:
      upstreams:
        - "https://doh.example/dns-query"
        - "https://doh2.example/dns-query|doh2"
      strategy: fastest
      timeout: 3
      health_checks: true

Concurrent (race) mode (legacy concurrent > 1):

plugins:
  - tag: forward_race
    type: forward
    args:
      upstreams:
        - "8.8.8.8:53"
        - "1.1.1.1:53"
      concurrent: 2

Logs and metrics

Look for log fields like upstream, elapsed_ms, queries, successes, and failures when debugging upstream behavior.

Troubleshooting

Best practices

See also