-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Chris Gianelloni <[email protected]>
- Loading branch information
Showing
10 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
zone "." { | ||
type master; | ||
file "/var/lib/bind/root.zone"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
zone "cardano" { | ||
type master; | ||
file "/var/lib/bind/cardano.zone"; | ||
}; | ||
|
||
// This is just for demo | ||
zone "treehouse.cardano" { | ||
type master; | ||
file "/var/lib/bind/treehouse.zone"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
options { | ||
directory "/var/cache/bind"; | ||
|
||
recursion yes; | ||
listen-on { any; }; | ||
allow-query { any; }; | ||
allow-query-cache { none; }; | ||
|
||
// forwarders { | ||
// 103.196.38.38; | ||
// 103.196.38.39; | ||
// }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
. 60 NS ns1.cardano. | ||
ns1.cardano. 60 A 172.17.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
. 86400 IN NS ns1.cardano. | ||
ns1.cardano. 86400 IN A 172.17.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
. 86400 IN SOA ns1.cardano. hostmaster.cardano. 1683227483 21600 3600 604800 60 | ||
. 86400 IN NS ns1.cardano. | ||
cardano. 86400 IN NS ns1.cardano. | ||
ns1.cardano. 86400 IN A 172.17.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$ORIGIN treehouse.cardano. | ||
$TTL 60 | ||
@ IN SOA ns1.treehouse.cardano. hostmaster.treehouse.cardano. 1683773269 21600 3600 604800 60 | ||
IN NS ns1.treehouse.cardano. | ||
IN NS ns2.treehouse.cardano. | ||
ns1 IN A 172.17.0.1 | ||
ns2 IN A 172.17.0.1 | ||
www IN CNAME www.google.com. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
$ORIGIN cardano. | ||
$TTL 60 | ||
@ IN SOA ns.cardano. hostmaster.cardano. (1683227483, 21600, 3600, 604800, 60) | ||
@ IN SOA ns1.cardano. hostmaster.cardano. 1683773269 21600 3600 604800 60 | ||
IN NS ns1.cardano. | ||
ns1.cardano. IN A 172.17.0.1 | ||
treehouse IN NS ns1.treehouse.cardano. | ||
ns1.treehouse.cardano. IN A 172.17.0.1 | ||
treehouse IN NS ns2.treehouse.cardano. | ||
ns2.treehouse.cardano. IN A 172.17.0.1 | ||
test IN NS ns1.test.cardano. | ||
ns1.test.cardano. IN A 172.17.0.1 | ||
test IN NS ns2.test.cardano. | ||
ns2.test.cardano. IN A 172.17.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo Starting BIND server container | ||
docker run -d \ | ||
--name bind9-container \ | ||
-e TZ=UTC \ | ||
-p 30053:53 \ | ||
-v $(pwd -P)/bind/named.conf.options:/etc/bind/named.conf.options \ | ||
-v $(pwd -P)/bind/named.conf.default-zones:/etc/bind/named.conf.default-zones \ | ||
-v $(pwd -P)/bind/named.conf.local:/etc/bind/named.conf.local \ | ||
-v $(pwd -P)/bind/root.hints:/usr/share/dns/root.hints \ | ||
-v $(pwd -P)/bind/root.zone:/var/lib/bind/root.zone \ | ||
-v $(pwd -P)/cardano.zone:/var/lib/bind/cardano.zone \ | ||
-v $(pwd -P)/bind/treehouse.zone:/var/lib/bind/treehouse.zone \ | ||
ubuntu/bind9:9.18-22.04_beta | ||
|
||
sleep 1 | ||
__dns=$(docker exec -ti bind9-container ip addr show eth0 | grep inet | awk '{print $2}' | cut -d/ -f1) | ||
|
||
echo Looking up . NS records | ||
dig @${__dns} . NS | ||
sleep 1 | ||
|
||
echo | ||
echo | ||
|
||
echo Looking up . A records | ||
dig @${__dns} . A | ||
sleep 1 | ||
|
||
echo | ||
echo | ||
|
||
echo Looking up ns1.cardano A records | ||
dig @${__dns} ns1.cardano A | ||
sleep 1 | ||
|
||
echo | ||
echo | ||
|
||
echo Looking up ns1.treehouse.cardano A records | ||
dig @${__dns} ns1.treehouse.cardano A | ||
sleep 1 | ||
|
||
echo | ||
echo | ||
|
||
echo Looking up www.treehouse.cardano CNAME record | ||
dig @${__dns} www.treehouse.cardano CNAME | ||
sleep 1 | ||
|
||
docker rm -f bind9-container 2>&1 >/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters