Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions actor-tests/src/test/bind/etc/db.0

This file was deleted.

13 changes: 0 additions & 13 deletions actor-tests/src/test/bind/etc/db.127

This file was deleted.

12 changes: 0 additions & 12 deletions actor-tests/src/test/bind/etc/db.255

This file was deleted.

2 changes: 1 addition & 1 deletion actor-tests/src/test/bind/etc/db.bar.example
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ $TTL 86400

@ IN NS example
example IN A 192.168.2.19
a-single IN A 192.168.2.20
a-single IN A 192.168.2.20
14 changes: 0 additions & 14 deletions actor-tests/src/test/bind/etc/db.empty

This file was deleted.

3 changes: 1 addition & 2 deletions actor-tests/src/test/bind/etc/db.foo.test
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ _service._tcp 86400 IN SRV 10 65534 5060 a-single
_service._tcp 86400 IN SRV 65533 40 65535 a-double

cname-in IN CNAME a-double
cname-ext IN CNAME a-single.bar.example.

cname-ext IN CNAME a-single.bar.example.
14 changes: 0 additions & 14 deletions actor-tests/src/test/bind/etc/db.local

This file was deleted.

90 changes: 0 additions & 90 deletions actor-tests/src/test/bind/etc/db.root

This file was deleted.

11 changes: 0 additions & 11 deletions actor-tests/src/test/bind/etc/named.conf

This file was deleted.

30 changes: 0 additions & 30 deletions actor-tests/src/test/bind/etc/named.conf.default-zones

This file was deleted.

8 changes: 4 additions & 4 deletions actor-tests/src/test/bind/etc/named.conf.local
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

// Consider adding the 1918 zones here, if they are not used in your
// organization
include "/etc/bind/zones.rfc1918";
include "/etc/bind/local-config/zones.rfc1918";

zone "bar.example" {
type master;
file "/etc/bind/db.bar.example";
file "/etc/bind/local-config/db.bar.example";
};

zone "foo.test" {
type master;
file "/etc/bind/db.foo.test";
};
file "/etc/bind/local-config/db.foo.test";
};
23 changes: 15 additions & 8 deletions actor-tests/src/test/bind/etc/named.conf.options
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
options {
directory "/var/cache/bind";

// If there is a firewall between you and nameservers you want
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See https://www.kb.cert.org/vuls/id/800113

Expand All @@ -18,9 +17,17 @@ options {
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;

auth-nxdomain no; # conform to RFC1035
listen-on-v6 { none; };

dnssec-validation no;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
max-cache-size 90%;
response-policy { zone "rpz"; };
forwarders {
8.8.8.8;
};
recursion yes;
allow-recursion {
any;
};
};

4 changes: 0 additions & 4 deletions actor-tests/src/test/bind/etc/rndc.key

This file was deleted.

2 changes: 1 addition & 1 deletion actor-tests/src/test/bind/etc/zones.rfc1918
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ zone "29.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "30.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "31.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };

zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) wi
log.info("Running on port port {}", hostPort)
super.atStartup()

// https://github.com/sameersbn/docker-bind/pull/61
val image = "raboof/bind:9.11.3-20180713-nochown"
// Use cytopia/bind which supports multi-platform including ARM64 for Apple M series machines
// and is battle-tested with 5M+ downloads (vs 322 for jonasal/bind)
// https://github.com/cytopia/docker-bind
val image = "cytopia/bind:latest"
try {
client
.pullImageCmd(image)
Expand All @@ -71,15 +73,23 @@ abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) wi
val containerCommand: CreateContainerCmd = client
.createContainerCmd(image)
.withName(containerName)
.withEnv("NO_CHOWN=true")
.withCmd("-4")
.withEnv(
"DNS_A=a-single.bar.example=192.168.2.20",
"DNS_CNAME=cname-ext.foo.test=a-single.bar.example",
"ALLOW_RECURSION=any",
"DNS_FORWARDER=8.8.8.8"
)
.withHostConfig(
HostConfig.newHostConfig()
.withBinds(
Bind.parse(s"${System.getProperty("user.dir")}/actor-tests/src/test/bind/etc:/etc/bind/local-config"),
Bind.parse(
s"${System.getProperty("user.dir")}/actor-tests/src/test/bind/etc/named.conf.local:/etc/bind/named.conf.local"),
Bind.parse(
s"${System.getProperty("user.dir")}/actor-tests/src/test/bind/etc/named.conf.options:/etc/bind/named.conf.options"))
.withPortBindings(
PortBinding.parse(s"$hostPort:53/tcp"),
PortBinding.parse(s"$hostPort:53/udp"))
.withBinds(new Bind(new java.io.File("actor-tests/src/test/bind/").getAbsolutePath,
new Volume("/data/bind"))))
PortBinding.parse(s"$hostPort:53/udp")))

client
.listContainersCmd()
Expand All @@ -104,10 +114,11 @@ abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) wi
eventually(timeout(25.seconds)) {
client
.logContainerCmd(creation.getId())
.withStdOut(true)
.withStdErr(true)
.exec(reader)

reader.toString should include("all zones loaded")
reader.toString should include("Starting BIND")
}
}

Expand Down