# struggledns

A simple server which allows you to forward dns requests to multiple dns servers
(regardless of which are the authoritative servers) and return the first usable

This is a small utility which we found useful in our development environments as
something which can run locally inside vagrant. It is not recommended to use
this in production or any high-load situation.

## Build

    go get

## Usage

Parameters can be set using (in order of precedence):

- Command line parameters
- Environment variables (e.g. `STRUGGLEDNS_LISTEN_ADDR`)
- Configuration file (see `--example` command line parameter)

## Example

    struggledns --fwd-to --fwd-to

When a dns request is received using this configuration, struggledns will first
see if the server at `` is alive and returns a dns response with a
non-empty answer section. If so that is returned, otherwise the server at
`` will be checked. The order of checking is always in the order the
`--fwd-to` parameters are specified.

### Groups

    struggledns --fwd-to, --fwd-to,

Each `--fwd-to` can be a group of comma-delimited addresses to query in
parallel. Every address in a group is queried in parallel and groups are queried
in serial unless `--parallel` is specified, which causes **all** sent addresses
from all groups to be queried in parallel. The response still respects the order
of the addresses despite being sent in parallel. In the above example, when a
query is received it will be first sent to both `` and ``
and if both of those fail then it will make a request to both `` and

Imports 3 package(s)


Test imports 2 package(s)