mirror of
https://github.com/folbricht/routedns.git
synced 2025-12-30 06:00:14 -06:00
Provide container build (#104)
This commit is contained in:
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
||||
.git
|
||||
.github
|
||||
.dockerignore
|
||||
**/.gitignore
|
||||
**/*.md
|
||||
Dockerfile
|
||||
doc
|
||||
testdata
|
||||
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM golang:alpine as builder
|
||||
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
WORKDIR cmd/routedns
|
||||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build
|
||||
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /build/cmd/routedns/routedns .
|
||||
COPY cmd/routedns/example-config/simple-dot-proxy.toml config.toml
|
||||
EXPOSE 53/tcp 53/udp
|
||||
ENTRYPOINT ["/routedns"]
|
||||
CMD ["config.toml"]
|
||||
22
README.md
22
README.md
@@ -47,6 +47,28 @@ An example systemd service file is provided [here](cmd/routedns/routedns.service
|
||||
|
||||
Example configuration files for a number of use-cases can be found [here](cmd/routedns/example-config)
|
||||
|
||||
### Docker container
|
||||
|
||||
A container is available on [Docker Hub](https://hub.docker.com/r/folbricht/routedns). It comes with a very basic configuration which is expected to be overwritten with a custom config file.
|
||||
|
||||
Use the default config (simple DNS -> DoT proxy):
|
||||
|
||||
```text
|
||||
docker run -d --rm --network host folbricht/routedns
|
||||
```
|
||||
|
||||
Override the default configuration (`/config.toml`) with a config file on the host:
|
||||
|
||||
```text
|
||||
docker run -d --rm --network host -v /path/to/config.toml:/config.toml folbricht/routedns
|
||||
```
|
||||
|
||||
Listen on non-standard ports:
|
||||
|
||||
```text
|
||||
docker run -d --rm -p 5353:53/udp -p 5353:53/tcp -v /path/to/config.toml:/config.toml folbricht/routedns
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
RouteDNS supports building complex DNS processing pipelines. A typically configuration would have one or more listeners to receive queries, several modifiers and routers to process the query (or responses), and then several resolvers that pass the query to upstream DNS services. See the [Configuration Guide](doc/configuration.md) for details on how to setup a pipeline.
|
||||
|
||||
10
cmd/routedns/example-config/doq-client-simple.toml
Normal file
10
cmd/routedns/example-config/doq-client-simple.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
# Simple config using a public DoQ server
|
||||
|
||||
[resolvers.adguard-doq]
|
||||
address = "dns-unfiltered.adguard.com:784"
|
||||
protocol = "doq"
|
||||
|
||||
[listeners.local-udp]
|
||||
address = "127.0.0.1:53"
|
||||
protocol = "udp"
|
||||
resolver = "adguard-doq"
|
||||
16
cmd/routedns/example-config/simple-dot-proxy.toml
Normal file
16
cmd/routedns/example-config/simple-dot-proxy.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
# Basic DNS proxy. Translate all plain DNS queries received on port 53
|
||||
# into DNS-over-TLS queries to Cloudflare's DNS server.
|
||||
|
||||
[resolvers.cloudflare-dot]
|
||||
address = "1.1.1.1:853"
|
||||
protocol = "dot"
|
||||
|
||||
[listeners.local-udp]
|
||||
address = ":53"
|
||||
protocol = "udp"
|
||||
resolver = "cloudflare-dot"
|
||||
|
||||
[listeners.local-tcp]
|
||||
address = ":53"
|
||||
protocol = "tcp"
|
||||
resolver = "cloudflare-dot"
|
||||
Reference in New Issue
Block a user