diff --git a/actor-tests/src/test/bind/etc/db.0 b/actor-tests/src/test/bind/etc/db.0 deleted file mode 100755 index e3aabdbeed1..00000000000 --- a/actor-tests/src/test/bind/etc/db.0 +++ /dev/null @@ -1,12 +0,0 @@ -; -; BIND reverse data file for broadcast zone -; -$TTL 604800 -@ IN SOA localhost. root.localhost. ( - 1 ; Serial - 604800 ; Refresh - 86400 ; Retry - 2419200 ; Expire - 604800 ) ; Negative Cache TTL -; -@ IN NS localhost. diff --git a/actor-tests/src/test/bind/etc/db.127 b/actor-tests/src/test/bind/etc/db.127 deleted file mode 100755 index cd05bef14a5..00000000000 --- a/actor-tests/src/test/bind/etc/db.127 +++ /dev/null @@ -1,13 +0,0 @@ -; -; BIND reverse data file for local loopback interface -; -$TTL 604800 -@ IN SOA localhost. root.localhost. ( - 1 ; Serial - 604800 ; Refresh - 86400 ; Retry - 2419200 ; Expire - 604800 ) ; Negative Cache TTL -; -@ IN NS localhost. -1.0.0 IN PTR localhost. diff --git a/actor-tests/src/test/bind/etc/db.255 b/actor-tests/src/test/bind/etc/db.255 deleted file mode 100755 index e3aabdbeed1..00000000000 --- a/actor-tests/src/test/bind/etc/db.255 +++ /dev/null @@ -1,12 +0,0 @@ -; -; BIND reverse data file for broadcast zone -; -$TTL 604800 -@ IN SOA localhost. root.localhost. ( - 1 ; Serial - 604800 ; Refresh - 86400 ; Retry - 2419200 ; Expire - 604800 ) ; Negative Cache TTL -; -@ IN NS localhost. diff --git a/actor-tests/src/test/bind/etc/db.bar.example b/actor-tests/src/test/bind/etc/db.bar.example old mode 100755 new mode 100644 index fdbde5dd334..85a5dd15a24 --- a/actor-tests/src/test/bind/etc/db.bar.example +++ b/actor-tests/src/test/bind/etc/db.bar.example @@ -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 \ No newline at end of file diff --git a/actor-tests/src/test/bind/etc/db.empty b/actor-tests/src/test/bind/etc/db.empty deleted file mode 100755 index 8a128589a18..00000000000 --- a/actor-tests/src/test/bind/etc/db.empty +++ /dev/null @@ -1,14 +0,0 @@ -; BIND reverse data file for empty rfc1918 zone -; -; DO NOT EDIT THIS FILE - it is used for multiple zones. -; Instead, copy it, edit named.conf, and use that copy. -; -$TTL 86400 -@ IN SOA localhost. root.localhost. ( - 1 ; Serial - 604800 ; Refresh - 86400 ; Retry - 2419200 ; Expire - 86400 ) ; Negative Cache TTL -; -@ IN NS localhost. diff --git a/actor-tests/src/test/bind/etc/db.foo.test b/actor-tests/src/test/bind/etc/db.foo.test old mode 100755 new mode 100644 index d64f28e3e4e..94e97f8e127 --- a/actor-tests/src/test/bind/etc/db.foo.test +++ b/actor-tests/src/test/bind/etc/db.foo.test @@ -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. \ No newline at end of file diff --git a/actor-tests/src/test/bind/etc/db.local b/actor-tests/src/test/bind/etc/db.local deleted file mode 100755 index 2f272d40838..00000000000 --- a/actor-tests/src/test/bind/etc/db.local +++ /dev/null @@ -1,14 +0,0 @@ -; -; BIND data file for local loopback interface -; -$TTL 604800 -@ IN SOA localhost. root.localhost. ( - 2 ; Serial - 604800 ; Refresh - 86400 ; Retry - 2419200 ; Expire - 604800 ) ; Negative Cache TTL -; -@ IN NS localhost. -@ IN A 127.0.0.1 -@ IN AAAA ::1 diff --git a/actor-tests/src/test/bind/etc/db.root b/actor-tests/src/test/bind/etc/db.root deleted file mode 100755 index f0b79d2af39..00000000000 --- a/actor-tests/src/test/bind/etc/db.root +++ /dev/null @@ -1,90 +0,0 @@ -; This file holds the information on root name servers needed to -; initialize cache of Internet domain name servers -; (e.g. reference this file in the "cache . " -; configuration file of BIND domain name servers). -; -; This file is made available by InterNIC -; under anonymous FTP as -; file /domain/named.cache -; on server FTP.INTERNIC.NET -; -OR- RS.INTERNIC.NET -; -; last update: February 17, 2016 -; related version of root zone: 2016021701 -; -; formerly NS.INTERNIC.NET -; -. 3600000 NS A.ROOT-SERVERS.NET. -A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 -A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:ba3e::2:30 -; -; FORMERLY NS1.ISI.EDU -; -. 3600000 NS B.ROOT-SERVERS.NET. -B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 -B.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:84::b -; -; FORMERLY C.PSI.NET -; -. 3600000 NS C.ROOT-SERVERS.NET. -C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 -C.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2::c -; -; FORMERLY TERP.UMD.EDU -; -. 3600000 NS D.ROOT-SERVERS.NET. -D.ROOT-SERVERS.NET. 3600000 A 199.7.91.13 -D.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2d::d -; -; FORMERLY NS.NASA.GOV -; -. 3600000 NS E.ROOT-SERVERS.NET. -E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 -; -; FORMERLY NS.ISC.ORG -; -. 3600000 NS F.ROOT-SERVERS.NET. -F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 -F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f -; -; FORMERLY NS.NIC.DDN.MIL -; -. 3600000 NS G.ROOT-SERVERS.NET. -G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 -; -; FORMERLY AOS.ARL.ARMY.MIL -; -. 3600000 NS H.ROOT-SERVERS.NET. -H.ROOT-SERVERS.NET. 3600000 A 198.97.190.53 -H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::53 -; -; FORMERLY NIC.NORDU.NET -; -. 3600000 NS I.ROOT-SERVERS.NET. -I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 -I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fe::53 -; -; OPERATED BY VERISIGN, INC. -; -. 3600000 NS J.ROOT-SERVERS.NET. -J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 -J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:c27::2:30 -; -; OPERATED BY RIPE NCC -; -. 3600000 NS K.ROOT-SERVERS.NET. -K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 -K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 -; -; OPERATED BY ICANN -; -. 3600000 NS L.ROOT-SERVERS.NET. -L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 -L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 -; -; OPERATED BY WIDE -; -. 3600000 NS M.ROOT-SERVERS.NET. -M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 -M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 -; End of file diff --git a/actor-tests/src/test/bind/etc/named.conf b/actor-tests/src/test/bind/etc/named.conf deleted file mode 100755 index 880786afdc8..00000000000 --- a/actor-tests/src/test/bind/etc/named.conf +++ /dev/null @@ -1,11 +0,0 @@ -// This is the primary configuration file for the BIND DNS server named. -// -// Please read /usr/share/doc/bind9/README.Debian.gz for information on the -// structure of BIND configuration files in Debian, *BEFORE* you customize -// this configuration file. -// -// If you are just adding zones, please do that in /etc/bind/named.conf.local - -include "/etc/bind/named.conf.options"; -include "/etc/bind/named.conf.local"; -include "/etc/bind/named.conf.default-zones"; diff --git a/actor-tests/src/test/bind/etc/named.conf.default-zones b/actor-tests/src/test/bind/etc/named.conf.default-zones deleted file mode 100755 index 355338bdaa5..00000000000 --- a/actor-tests/src/test/bind/etc/named.conf.default-zones +++ /dev/null @@ -1,30 +0,0 @@ -// prime the server with knowledge of the root servers -zone "." { - type hint; - file "/etc/bind/db.root"; -}; - -// be authoritative for the localhost forward and reverse zones, and for -// broadcast zones as per RFC 1912 - -zone "localhost" { - type master; - file "/etc/bind/db.local"; -}; - -zone "127.in-addr.arpa" { - type master; - file "/etc/bind/db.127"; -}; - -zone "0.in-addr.arpa" { - type master; - file "/etc/bind/db.0"; -}; - -zone "255.in-addr.arpa" { - type master; - file "/etc/bind/db.255"; -}; - - diff --git a/actor-tests/src/test/bind/etc/named.conf.local b/actor-tests/src/test/bind/etc/named.conf.local old mode 100755 new mode 100644 index 55e6e4ae322..eced8adb35a --- a/actor-tests/src/test/bind/etc/named.conf.local +++ b/actor-tests/src/test/bind/etc/named.conf.local @@ -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"; +}; \ No newline at end of file diff --git a/actor-tests/src/test/bind/etc/named.conf.options b/actor-tests/src/test/bind/etc/named.conf.options old mode 100755 new mode 100644 index 26ad3181a75..ae9b6d67de4 --- a/actor-tests/src/test/bind/etc/named.conf.options +++ b/actor-tests/src/test/bind/etc/named.conf.options @@ -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 @@ -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; + }; }; - diff --git a/actor-tests/src/test/bind/etc/rndc.key b/actor-tests/src/test/bind/etc/rndc.key deleted file mode 100755 index b3be32ede3a..00000000000 --- a/actor-tests/src/test/bind/etc/rndc.key +++ /dev/null @@ -1,4 +0,0 @@ -key "rndc-key" { - algorithm hmac-md5; - secret "WNiF81LrIxYbbPwt/twgUA=="; -}; diff --git a/actor-tests/src/test/bind/etc/zones.rfc1918 b/actor-tests/src/test/bind/etc/zones.rfc1918 old mode 100755 new mode 100644 index 03b5546296d..abc0b1ee71a --- a/actor-tests/src/test/bind/etc/zones.rfc1918 +++ b/actor-tests/src/test/bind/etc/zones.rfc1918 @@ -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"; }; \ No newline at end of file diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala index 97fe875866d..76dfc2bd366 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala @@ -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) @@ -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() @@ -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") } }