From de3677baa5ad393b4f9f0e4922615f8d1c9ad9c4 Mon Sep 17 00:00:00 2001 From: Simon Marsh Date: Tue, 22 Sep 2020 19:48:09 +0100 Subject: [PATCH] initial zones --- dnsconfig.js | 16 ++++- domains/010-reverse.js | 47 ++++++++++++++ domains/020-burble.com.js | 7 +++ domains/030-burble.dn42.js | 105 +++++++++++++++++++++++++++++++ domains/040-collector.dn42.js | 26 ++++++++ dynamic/nodes.js | 26 ++++++++ dynamic/virtual.js | 113 ++++++++++++++++++++++++++++++++++ utils/common.js | 54 ++++++++++++++++ utils/domains.js | 22 +++++++ 9 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 domains/010-reverse.js create mode 100644 domains/020-burble.com.js create mode 100644 domains/030-burble.dn42.js create mode 100644 domains/040-collector.dn42.js create mode 100644 dynamic/nodes.js create mode 100644 dynamic/virtual.js create mode 100644 utils/common.js create mode 100644 utils/domains.js diff --git a/dnsconfig.js b/dnsconfig.js index bb8fc26..e9372bc 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -10,8 +10,22 @@ var PDNS = NewDnsProvider( } ); -var domain; ////////////////////////////////////////////////////////////////////////// +// turn off cloudflare proxying by default + +DEFAULTS( + CF_PROXY_DEFAULT_OFF +); + +var domain; + +////////////////////////////////////////////////////////////////////////// + +// import util files +require_glob('utils/', false) + +// import dynamic info +require_glob('dynamic/', false) // import individual domain files require_glob('domains/', false) diff --git a/domains/010-reverse.js b/domains/010-reverse.js new file mode 100644 index 0000000..fb0d86a --- /dev/null +++ b/domains/010-reverse.js @@ -0,0 +1,47 @@ +////////////////////////////////////////////////////////////////////////// +// define domains + +// burble.dn42 +var rz_s4 = REV('172.20.129.0/27'); +var rz_n4 = REV('172.20.129.160/27'); +var rz_6 = REV('fd42:4242:2601::/48'); +pdns_domain(rz_s4); +pdns_domain(rz_n4); +pdns_domain(rz_6); + +////////////////////////////////////////////////////////////////////////// +// special reverse zones + +// b.master.delegation-servers.dn42 +var rz_master = REV('fd42:180:3de0:30::/64'); +pdns_domain(rz_master); + +D_EXTEND( + rz_master, + PTR('fd42:180:3de0:30::1', 'b.master.delegation-servers.dn42.') +); + +// Registry Services +var rz_regsvc4 = REV('172.22.63.0/28'); +var rz_regsvc6 = REV('fd42:180:3de0:100::/64'); + +pdns_domain(rz_regsvc4); +D_EXTEND( + rz_regsvc4, + PTR('172.22.63.1', 'route.git.dn42.'), + PTR('172.22.63.2', 'git.dn42.'), + PTR('172.22.63.3', 'drone.git.dn42.'), + PTR('172.22.63.4', 'runners.git.dn42.') +); + +pdns_domain(rz_regsvc6); +D_EXTEND( + rz_regsvc6, + PTR('fd42:180:3de0:100::1', 'route.git.dn42.'), + PTR('fd42:180:3de0:100:fc5f:3a14:838e:a7a7', 'git.dn42.'), + PTR('fd42:180:3de0:100:42e6:9ff:fe09:bfc0', 'drone.git.dn42.'), + PTR('fd42:180:3de0:100:216:3eff:fecd:471f', 'runners.git.dn42.') +); + +////////////////////////////////////////////////////////////////////////// +// end of file diff --git a/domains/020-burble.com.js b/domains/020-burble.com.js new file mode 100644 index 0000000..c942d9e --- /dev/null +++ b/domains/020-burble.com.js @@ -0,0 +1,7 @@ +////////////////////////////////////////////////////////////////////////// +// define domains + + +////////////////////////////////////////////////////////////////////////// +// end of file + diff --git a/domains/030-burble.dn42.js b/domains/030-burble.dn42.js new file mode 100644 index 0000000..ee75486 --- /dev/null +++ b/domains/030-burble.dn42.js @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////// +// define domains + +domain='burble.dn42'; +pdns_domain(domain); + +////////////////////////////////////////////////////////////////////////// +// special records + +D_EXTEND( + domain, + TXT('canary', "It's Alive!", TTL(1)) +); + +////////////////////////////////////////////////////////////////////////// +// services + +// IPv4 service names +service('ns1', 'fd42:4242:2601:ac53::1', '172.20.129.1'); +service('dns', 'fd42:4242:2601:ac53::53', '172.20.129.2'); +service('@', 'fd42:4242:2601:ac80::1', '172.20.129.3'); +service('grc', 'fd42:4242:2601:ac12::1', '172.20.129.4'); +service('pingable', 'fd42:4242:2601:ac05::1', '172.20.129.5'); +// 172.20.129.6 was wiki but not now used +service('rproxy', 'fd42:4242:2601:acf0::1', '172.20.129.7'); +service('whois', 'fd42:4242:2601:ac43::1', '172.20.129.8'); +// services 172.20.129.9 -> 172.20.129.31 are unassigned + +// internal anycasts +service('rpki', 'fd42:4242:2601:ac10::1'); +service('dns64', 'fd42:4242:2601:ac53::64'), +service('wiki.service', 'fd42:4242:2601:ac00::10:1'), +service('dn42regsrv', 'fd42:4242:2601:ac00::20:1'); +service('dns-slave', 'fd42:4242:2601:ac00::53:1'); +service('consul.service', 'fd42:4242:2601:acf0::10:1'), +service('vault.service', 'fd42:4242:2601:acf0::20:1'), +service('acme', 'fd42:4242:2601:acf0::30:1'), + +// proxied services +proxied('explorer'); +proxied('git'); +proxied('ci'); +proxied('glass'); +proxied('lg'); +proxied('wiki'); +proxied('lounge'); +proxied('nextcloud'); +proxied('alertmanager'); +proxied('monitor'); +proxied('grafana'); +proxied('consul'); +proxied('vault'); +proxied('paste'); +proxied('tasks'); + +// other service cnames +D_EXTEND( + domain, + + // global service aliases + CNAME('www', 'burble.dn42.'), + + // local service aliases + CNAME('wiki.us', 'rproxy.us-dal3.burble.dn42.'), + CNAME('wiki.fr', 'rproxy.fr-sbg1.burble.dn42.'), + CNAME('wiki.sg', 'rproxy.sg-sin1.burble.dn42.'), + CNAME('wiki.ca', 'rproxy.ca-bhs2.burble.dn42.'), + + // host aliases + CNAME('repo', 'repo.fr-sbg1.burble.dn42.'), + + // grc SSHFP + SSHFP('grc', 4, 1, 'ff61153c18334e89df3b4b4e4696306eeb5ffe9c'), + SSHFP('grc', 4, 2, 'c3a2470309cb1e6fba252231a6504a096ffd8b6f92442493f762e7512c515e76') +); + +////////////////////////////////////////////////////////////////////////// +// hosts + +// main nodes + +nodes.forEach(function(n) { + var hex = (n[4] + 32).toString(16); + var ip4 = (n[5] == 'undefined' ? undefined : n[5]); + + // main IP + host(n[0],'fd42:4242:2601:'+hex+'::1', ip4); + // tier2 IP + host('tier2.'+n[0], 'fd42:4242:2601:'+hex+'02::1'); + + // create dn42-xxx CNAME for dn42 nodes + if (n[3] == 'true') { + D_EXTEND(domain,CNAME('dn42-'+n[0], n[0]+'.burble.dn42.')); + } +}); + +// containers and VMs + +virtual.forEach(function(v) { + host(v[0], v[1], v[2]); +}); + +////////////////////////////////////////////////////////////////////////// +// end of file + diff --git a/domains/040-collector.dn42.js b/domains/040-collector.dn42.js new file mode 100644 index 0000000..de26e29 --- /dev/null +++ b/domains/040-collector.dn42.js @@ -0,0 +1,26 @@ +////////////////////////////////////////////////////////////////////////// +// define domain + +domain='collector.dn42'; +pdns_domain(domain); + +////////////////////////////////////////////////////////////////////////// +// services + +// dn42regsrv +proxied('explorer'); + +// looking flass +proxied('lg'); + +// ssh interface +service('@', 'fd42:4242:2601:ac12::1', '172.20.129.4'); + +D_EXTEND( + domain, + SSHFP('@', 4, 1, 'ff61153c18334e89df3b4b4e4696306eeb5ffe9c'), + SSHFP('@', 4, 2, 'c3a2470309cb1e6fba252231a6504a096ffd8b6f92442493f762e7512c515e76') +); + +////////////////////////////////////////////////////////////////////////// +// end of file diff --git a/dynamic/nodes.js b/dynamic/nodes.js new file mode 100644 index 0000000..68e7030 --- /dev/null +++ b/dynamic/nodes.js @@ -0,0 +1,26 @@ +var nodes = [ + [ 'au-syd1', '139.99.237.85', '2402:1f00:8100:400::279', 'true', 24, '172.20.129.180' ], + [ 'ca-bhs2', '158.69.248.26', '2607:5300:120:81a::1', 'true', 13, '172.20.129.167' ], + [ 'ch-zur1', '45.91.92.111', '2a0e:dc0:6:8::1', 'true', 8, '172.20.129.174' ], + [ 'de-fra1', '193.41.237.149', '2a0d:5941:1:17c::4e2a', 'true', 17, '172.20.129.169' ], + [ 'fr-rbx1', '37.59.47.71', '2001:41d0:8:6a47::1', 'true', 22, '172.20.129.188' ], + [ 'fr-sbg1', '37.187.174.185', '2001:41d0:d:db9::1', 'true', 3, '172.20.129.179' ], + [ 'jp-tyo1', '172.93.221.101', '2403:71c0:2000::d:8b97', 'true', 30, '172.20.129.182' ], + [ 'nl-ams1', '185.185.41.118', '2a0b:7080:10::1:cae4', 'false', 19, 'undefined' ], + [ 'no-trd1', '217.168.87.226', '2001:678:dd0:ffff::25', 'true', 25, '172.20.129.185' ], + [ 'ro-ord1', '193.148.70.15', 'undefined', 'false', 15, 'undefined' ], + [ 'sg-sin1', '5.34.177.110', '2a05:9401:0:acdc::210', 'true', 5, '172.20.129.177' ], + [ 'sg-sin2', '139.99.89.157', '2402:1f00:8000:800::3bc', 'true', 23, '172.20.129.181' ], + [ 'uk-lon1', '185.42.222.153', '2a04:92c5:2::1', 'true', 21, '172.20.129.187' ], + [ 'uk-lon2', '185.121.25.166', '2a04:92c7:e:537::96cb', 'false', 4, '172.20.129.178' ], + [ 'uk-lon3', '45.91.93.103', '2a0e:dc0:5:6::1', 'false', 7, 'undefined' ], + [ 'uk-lon4', '45.91.93.104', '2a0e:dc0:5:5::1', 'false', 9, '172.20.129.175' ], + [ 'uk-lon5', '185.121.25.242', '2a04:92c7:e:bd2::e6b9', 'false', 16, 'undefined' ], + [ 'us-chi1', '193.29.63.150', '2605:4840:3:10::ab2d', 'true', 14, '172.20.129.166' ], + [ 'us-dal3', '144.172.126.201', '2602:fe64:8::4', 'true', 10, '172.20.129.172' ], + [ 'us-lax1', '185.215.224.214', '2a0b:ae40:1:4a0a::5a', 'true', 26, '172.20.129.165' ], + [ 'us-mia2', '216.126.233.109', '2a09:be40:2908:bc43::1', 'true', 31, '172.20.129.164' ], + [ 'us-nyc1', '185.213.26.143', '2a0d:5600:33:b::1', 'true', 20, '172.20.129.168' ], + [ 'us-phx1', '162.251.160.61', '2605:8340:0:6::2', 'false', 11, '172.20.129.171' ], + [ 'us-sea2', '96.8.121.205', 'undefined', 'true', 12, '172.20.129.170' ] +]; diff --git a/dynamic/virtual.js b/dynamic/virtual.js new file mode 100644 index 0000000..33248a0 --- /dev/null +++ b/dynamic/virtual.js @@ -0,0 +1,113 @@ +var virtual = [ +// insert here + [ 'dns-edge.au-syd1', 'fd42:4242:2601:38:eb64:a09:8e94:ef18' ], + [ 'acme.tier2.ca-bhs2', 'fd42:4242:2601:2d02:1c41:aeff:fec2:8c12' ], + [ 'dn42regsrv.tier2.ca-bhs2', 'fd42:4242:2601:2d02:597c:45da:51a8:29a4' ], + [ 'dns-edge.ca-bhs2', 'fd42:4242:2601:2d:a291:8640:8e79:56f1' ], + [ 'dns-master.ca-bhs2', 'fd42:4242:2601:2d:216:3eff:fee0:8873' ], + [ 'dns-slave.tier2.ca-bhs2', 'fd42:4242:2601:2d02:6dce:78fa:6d26:cf7b' ], + [ 'gortr.ca-bhs2', 'fd42:4242:2601:2d:1abb:1cc2:5442:5172' ], + [ 'monitor.tier2.ca-bhs2', 'fd42:4242:2601:2d02:728f:3939:2c60:6608' ], + [ 'mysql.tier2.ca-bhs2', 'fd42:4242:2601:2d02:d29b:8414:24cf:b6b6' ], + [ 'nginx.ca-bhs2', 'fd42:4242:2601:2d:9102:2d5d:4022:581a' ], + [ 'vrenew.tier2.ca-bhs2', 'fd42:4242:2601:2d02:ea67:c62c:d820:8ca8' ], + [ 'whois42d.ca-bhs2', 'fd42:4242:2601:2d:462a:69d7:8ddc:ea94' ], + [ 'wiki.tier2.ca-bhs2', 'fd42:4242:2601:2d02:7860:ba86:c1d1:76b6' ], + [ 'dns-edge.ch-zur1', 'fd42:4242:2601:28:8a17:5860:8e20:9eaf' ], + [ 'dn42regsrv.tier2.de-fra1', 'fd42:4242:2601:3102:2543:b273:339a:95fb' ], + [ 'dns-edge.de-fra1', 'fd42:4242:2601:31:602:42bc:d3f7:8fc2' ], + [ 'gortr.de-fra1', 'fd42:4242:2601:31:156c:c76c:9e76:f8ff' ], + [ 'grafana.tier2.de-fra1', 'fd42:4242:2601:3102:b02a:191d:6529:5e4d' ], + [ 'monitor.tier2.de-fra1', 'fd42:4242:2601:3102:3cf5:54ff:fcab:810c' ], + [ 'nginx.de-fra1', 'fd42:4242:2601:31:38d6:76fd:b5f0:875' ], + [ 'vault.tier2.de-fra1', 'fd42:4242:2601:3102:b267:51ff:feed:503f' ], + [ 'whois42d.de-fra1', 'fd42:4242:2601:31:44c9:b966:bf38:bc8d' ], + [ 'dns-edge.fr-rbx1', 'fd42:4242:2601:36:6a45:5329:5770:c78' ], + [ 'lounge.tier2.fr-rbx1', 'fd42:4242:2601:3602:216:3eff:fe4d:38ff' ], + [ 'mysql.tier2.fr-rbx1', 'fd42:4242:2601:3602:6e22:e022:b25d:574a' ], + [ 'nginx.fr-rbx1', 'fd42:4242:2601:36:e59:a405:22dc:68f5' ], + [ 'shell.tier2.fr-rbx1', 'fd42:4242:2601:3602:216:3eff:fe88:d097' ], + [ 'usenet.tier2.fr-rbx1', 'fd42:4242:2601:3602:c021:4ac0:e169:b80a' ], + [ 'vault.tier2.fr-rbx1', 'fd42:4242:2601:3602:b267:51ff:feed:503f' ], + [ 'vrenew.tier2.fr-rbx1', 'fd42:4242:2601:3602:7f4c:78cf:3bc5:30b2' ], + [ 'abuild.tier2.fr-sbg1', 'fd42:4242:2601:2302:216:3eff:fe42:2f37' ], + [ 'acme.tier2.fr-sbg1', 'fd42:4242:2601:2302:1c41:aeff:fec2:8c12' ], + [ 'builder.tier2.fr-sbg1', 'fd42:4242:2601:2302:216:3eff:fe2c:4293' ], + [ 'collector.fr-sbg1', 'fd42:4242:2601:23:216:3eff:fe1b:d7d4' ], + [ 'dn42regsrv.tier2.fr-sbg1', 'fd42:4242:2601:2302:544:2432:538c:3168' ], + [ 'dns-bdn42.tier2.fr-sbg1', 'fd42:4242:2601:2302:216:3eff:fee3:5f7b' ], + [ 'dns-edge.fr-sbg1', 'fd42:4242:2601:23:b32e:2f3f:25ea:2a19' ], + [ 'dns-slave.tier2.fr-sbg1', 'fd42:4242:2601:2302:3639:4bf6:367b:9884' ], + [ 'drone-docker.tier2.fr-sbg1', 'fd42:4242:2601:2302:a2b1:9fff:fe64:4645' ], + [ 'drone-exec.tier2.fr-sbg1', 'fd42:4242:2601:2302:423b:9dff:fec1:7388' ], + [ 'drone-server.tier2.fr-sbg1', 'fd42:4242:2601:2302:42e6:9ff:fe09:bfc0' ], + [ 'git.tier2.fr-sbg1', 'fd42:4242:2601:2302:686:8c8d:698a:4dfe' ], + [ 'glass.tier2.fr-sbg1', 'fd42:4242:2601:2302:10df:9392:7d4d:d03b' ], + [ 'gortr.fr-sbg1', 'fd42:4242:2601:23:c0b0:bce2:c419:7f65' ], + [ 'monitor.tier2.fr-sbg1', 'fd42:4242:2601:2302:458f:bea6:1f82:642' ], + [ 'mysql.tier2.fr-sbg1', 'fd42:4242:2601:2302:9672:ab9c:16ad:7aee' ], + [ 'nginx.fr-sbg1', 'fd42:4242:2601:23:6569:5bb8:6271:9bb2' ], + [ 'php-apps.tier2.fr-sbg1', 'fd42:4242:2601:2302:43ee:d79d:b0b6:b235' ], + [ 'repo.tier2.fr-sbg1', 'fd42:4242:2601:2302:216:3eff:fec7:4d49' ], + [ 'rsync.tier2.fr-sbg1', 'fd42:4242:2601:2302:d2df:d7ff:fe86:283c' ], + [ 'shell.tier2.fr-sbg1', 'fd42:4242:2601:2302:216:3eff:fe0f:a70a' ], + [ 'snas.tier2.fr-sbg1', 'fd42:4242:2601:2302:216:3eff:fe89:4def' ], + [ 'vrenew.tier2.fr-sbg1', 'fd42:4242:2601:2302:972e:b53:e8f4:16ab' ], + [ 'whois42d.fr-sbg1', 'fd42:4242:2601:23:3ddb:8c9d:ff98:3202' ], + [ 'wiki.tier2.fr-sbg1', 'fd42:4242:2601:2302:5011:9ac9:2486:3ea8' ], + [ 'dns-edge.jp-tyo1', 'fd42:4242:2601:3e:2948:7cf2:4f88:3e0' ], + [ 'dns-edge.nl-ams1', 'fd42:4242:2601:33:f302:90e5:fc62:3c24' ], + [ 'vault.tier2.nl-ams1', 'fd42:4242:2601:3302:b267:51ff:feed:503f' ], + [ 'dns-edge.no-trd1', 'fd42:4242:2601:39:b09d:a8ee:ca57:6359' ], + [ 'dn42regsrv.tier2.sg-sin1', 'fd42:4242:2601:2502:6df2:ac9f:2667:61c1' ], + [ 'dns-edge.sg-sin1', 'fd42:4242:2601:25:f9a3:39bf:753f:6451' ], + [ 'dns-slave.tier2.sg-sin1', 'fd42:4242:2601:2502:cfe6:58b2:1b85:268b' ], + [ 'gortr.sg-sin1', 'fd42:4242:2601:25:3d:79b3:54b2:581f' ], + [ 'monitor.tier2.sg-sin1', 'fd42:4242:2601:2502:7146:2792:c757:9562' ], + [ 'mysql.tier2.sg-sin1', 'fd42:4242:2601:2502:6dac:9c42:a6d0:1ce3' ], + [ 'nginx.sg-sin1', 'fd42:4242:2601:25:9480:1cb3:7b59:b231' ], + [ 'vrenew.tier2.sg-sin1', 'fd42:4242:2601:2502:1ec9:2bff:3d01:3b2f' ], + [ 'whois42d.sg-sin1', 'fd42:4242:2601:25:4f11:11af:fc0f:b6d9' ], + [ 'wiki.tier2.sg-sin1', 'fd42:4242:2601:2502:9833:4bd5:f679:cfc9' ], + [ 'dns-edge.sg-sin2', 'fd42:4242:2601:37:8983:f9c6:79fb:b1dc' ], + [ 'alltube.tier2.uk-lon1', 'fd42:4242:2601:3502:62b5:7fff:fec5:a3e5' ], + [ 'deploy.tier2.uk-lon1', 'fd42:4242:2601:3502:216:3eff:fe4b:67' ], + [ 'dns-burble.tier2.uk-lon1', 'fd42:4242:2601:3502:d2d7:2cff:fe85:3bcc' ], + [ 'dns-edge.uk-lon1', 'fd42:4242:2601:35:d2f4:8ff:fec6:c157' ], + [ 'mysql.tier2.uk-lon1', 'fd42:4242:2601:3502:6291:1fff:fe63:f812' ], + [ 'nginx.uk-lon1', 'fd42:4242:2601:35:a09d:f086:fca0:a6be' ], + [ 'registry.tier2.uk-lon1', 'fd42:4242:2601:3502:216:3eff:fe08:2017' ], + [ 'shell.tier2.uk-lon1', 'fd42:4242:2601:3502:216:3eff:feec:ee2e' ], + [ 'vrenew.tier2.uk-lon1', 'fd42:4242:2601:3502:f204:e6ff:fe33:89ee' ], + [ 'mysql.uk-lon2', 'fd42:4242:2601:24:6ae6:fe39:50a5:489f' ], + [ 'php-apps.uk-lon2', 'fd42:4242:2601:24:fd52:c020:40a7:1327' ], + [ 'vrenew.uk-lon2', 'fd42:4242:2601:24:ba2a:a70a:36b2:d8ee' ], + [ 'borg.uk-lon3', 'fd42:4242:2601:27:216:3eff:feb5:aa3e' ], + [ 'jellyfin.tier2.uk-lon3', 'fd42:4242:2601:2702:216:3eff:fe16:65ac' ], + [ 'nextcloud.uk-lon3', 'fd42:4242:2601:27:216:3eff:feab:93f7' ], + [ 'dns-edge.us-chi1', 'fd42:4242:2601:2e:62a7:e3d8:cd7f:8b0c' ], + [ 'acme.tier2.us-dal3', 'fd42:4242:2601:2a02:1c41:aeff:fec2:8c12' ], + [ 'dn42regsrv.tier2.us-dal3', 'fd42:4242:2601:2a02:13e:613e:3f6d:8b88' ], + [ 'dns-edge.us-dal3', 'fd42:4242:2601:2a:afb8:9e7b:95f4:3f23' ], + [ 'dns-slave.tier2.us-dal3', 'fd42:4242:2601:2a02:c69f:6eeb:c5a4:f07b' ], + [ 'gortr.us-dal3', 'fd42:4242:2601:2a:cbd:9d20:10be:8414' ], + [ 'monitor.tier2.us-dal3', 'fd42:4242:2601:2a02:ac86:a4ad:f686:65ec' ], + [ 'mysql.tier2.us-dal3', 'fd42:4242:2601:2a02:1c73:475d:e677:3e33' ], + [ 'nginx.us-dal3', 'fd42:4242:2601:2a:491d:6fa5:b813:ca3c' ], + [ 'vrenew.tier2.us-dal3', 'fd42:4242:2601:2a02:7736:d009:4e49:40b0' ], + [ 'whois42d.us-dal3', 'fd42:4242:2601:2a:4eda:68e6:32c1:6900' ], + [ 'wiki.tier2.us-dal3', 'fd42:4242:2601:2a02:1b9d:a146:396b:1e8d' ], + [ 'dn42regsrv.tier2.us-lax1', 'fd42:4242:2601:3a02:30d:d2d4:ce54:720f' ], + [ 'dns-edge.us-lax1', 'fd42:4242:2601:3a:43b6:63c5:fc01:63d1' ], + [ 'dns-slave.tier2.us-lax1', 'fd42:4242:2601:3a02:e185:de19:de92:61fa' ], + [ 'gortr.us-lax1', 'fd42:4242:2601:3a:6a:1f9e:76c1:f7a2' ], + [ 'mysql.tier2.us-lax1', 'fd42:4242:2601:3a02:37be:10a8:cf9c:372b' ], + [ 'nginx.us-lax1', 'fd42:4242:2601:3a:68e1:8e62:63e9:4aae' ], + [ 'vrenew.tier2.us-lax1', 'fd42:4242:2601:3a02:69be:80cf:51c4:f166' ], + [ 'whois42d.us-lax1', 'fd42:4242:2601:3a:3745:c089:bcc2:d854' ], + [ 'wiki.tier2.us-lax1', 'fd42:4242:2601:3a02:efdc:854c:8183:37c6' ], + [ 'dns-edge.us-mia2', 'fd42:4242:2601:3f:86e5:9970:5fa2:f29e' ], + [ 'dns-edge.us-nyc1', 'fd42:4242:2601:34:6061:d537:27d:7fef' ], + [ 'docker.us-phx1', 'fd42:4242:2601:2b:216:3eff:fe26:b460' ], + [ 'dns-edge.us-sea2', 'fd42:4242:2601:2c:6ce:1268:c00f:6cc5' ] +]; diff --git a/utils/common.js b/utils/common.js new file mode 100644 index 0000000..099d4a3 --- /dev/null +++ b/utils/common.js @@ -0,0 +1,54 @@ +////////////////////////////////////////////////////////////////////////// +// !!!!!!!!!!!! +// most functions here assume the 'domain' variable is set +// !!!!!!!!!!!! +////////////////////////////////////////////////////////////////////////// + +function proxied(name) +{ + D_EXTEND( + domain, + CNAME(name, 'rproxy.burble.dn42.') + ); +} + +////////////////////////////////////////////////////////////////////////// + +function fqdn(name) +{ + if (name === '@') { + return domain+'.'; + } + return name+"."+domain+'.'; +} + +////////////////////////////////////////////////////////////////////////// + +// add a service including reverse DNS +function service(name, ipv6, ipv4) +{ + if (typeof ipv6 !== 'undefined') { + D_EXTEND(domain, AAAA(name, ipv6)); + D_EXTEND(rz_6, PTR(ipv6, fqdn(name))); + } + if (typeof ipv4 !== 'undefined') { + D_EXTEND(domain, A(name, ipv4)); + D_EXTEND(rz_s4, PTR(ipv4, fqdn(name))); + } +} + +// add a host, including reverse DNS +function host(name, ipv6, ipv4) +{ + if (typeof ipv6 !== 'undefined') { + D_EXTEND(domain, AAAA(name, ipv6)); + D_EXTEND(rz_6, PTR(ipv6, fqdn(name))); + } + if (typeof ipv4 !== 'undefined') { + D_EXTEND(domain, A(name, ipv4)); + D_EXTEND(rz_n4, PTR(ipv4, fqdn(name))); + } +} + +////////////////////////////////////////////////////////////////////////// +// end of file diff --git a/utils/domains.js b/utils/domains.js new file mode 100644 index 0000000..3659c1b --- /dev/null +++ b/utils/domains.js @@ -0,0 +1,22 @@ +////////////////////////////////////////////////////////////////////////// + +function pdns_domain(domain) +{ + D( + domain, + REG_NONE, + DnsProvider(PDNS), + NAMESERVER_TTL(86400), + NAMESERVER('ns1.burble.dn42.'), + DefaultTTL(3600) + ); +} + +function cf_domain(domain) +{ + D(domain, REG_NONE, DnsProvider(CF)) +} + +////////////////////////////////////////////////////////////////////////// +// end of file +