Skip to content

Commit

Permalink
Merge pull request MatthewVance#42 from Sispheor/dev
Browse files Browse the repository at this point in the history
[enhancement] add SRV records support
  • Loading branch information
MatthewVance authored May 21, 2020
2 parents 2bea6b8 + d447169 commit 56c169d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions 1.10.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ RUN set -x && \

COPY a-records.conf /opt/unbound/etc/unbound/
COPY forward-records.conf /opt/unbound/etc/unbound/
COPY srv-records.conf /opt/unbound/etc/unbound/
COPY unbound.sh /

RUN chmod +x /unbound.sh
Expand Down
2 changes: 2 additions & 0 deletions 1.10.0/srv-records.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SRV records
# _service._proto.name. | TTL | class | SRV | priority | weight | port | target.
1 change: 1 addition & 0 deletions 1.10.0/unbound.sh
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ server:
# Include file for local-data and local-data-ptr
include: /opt/unbound/etc/unbound/a-records.conf
include: /opt/unbound/etc/unbound/srv-records.conf
###########################################################################
# FORWARD ZONE
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ custom entries on a small, private LAN. In other words, you can use Unbound to
resolve fake names such as your-computer.local within your LAN.

To support such custom entries using this image, you need to provide an
`a-records.conf` file. This conf file is where you will define your custom
`a-records.conf` or `srv-records.conf` file.
This conf file is where you will define your custom
entries for forward and reverse resolution.

#### A records

The `a-records.conf` file should use the following format:

```
Expand All @@ -74,8 +77,29 @@ Once the file has your entries in it, mount your version of the file as a volume
when starting the container:

```console
docker run --name my-unbound -d -p 53:53/udp -p 53:53/tcp -v \
$(pwd)/a-records.conf:/opt/unbound/etc/unbound/a-records.conf:ro \
docker run --name my-unbound -d \
-p 53:53/udp -p 53:53/tcp \
-v $(pwd)/a-records.conf:/opt/unbound/etc/unbound/a-records.conf:ro \
--restart=always mvance/unbound:latest
```

#### SRV records

The `srv-records.conf` file should use the following format:

```
# SRV records
# _service._proto.name. | TTL | class | SRV | priority | weight | port | target.
_etcd-server-ssl._tcp.domain.local. 86400 IN SRV 0 10 2380 etcd-0.domain.local.
_etcd-server-ssl._tcp.domain.local. 86400 IN SRV 0 10 2380 etcd-1.domain.local.
_etcd-server-ssl._tcp.domain.local. 86400 IN SRV 0 10 2380 etcd-2.domain.local.
```

Run a container taht use this SRV config file:
```console
docker run --name my-unbound -d \
-p 53:53/udp -p 53:53/tcp \
-v $(pwd)/srv-records.conf:/opt/unbound/etc/unbound/srv-records.conf:ro \
--restart=always mvance/unbound:latest
```

Expand Down

0 comments on commit 56c169d

Please sign in to comment.