From c41de695d26c18b15d5382a8233b6db2c351439c Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Thu, 9 May 2024 04:12:28 +0200 Subject: [PATCH] Add dns config --- home/features/cli/scripts/uptimes.sh | 2 +- scripts/dns/delete-all-records.sh | 10 +++++ scripts/dns/dns.txt | 58 ++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 scripts/dns/delete-all-records.sh create mode 100644 scripts/dns/dns.txt diff --git a/home/features/cli/scripts/uptimes.sh b/home/features/cli/scripts/uptimes.sh index 0d420c7..4c6434b 100755 --- a/home/features/cli/scripts/uptimes.sh +++ b/home/features/cli/scripts/uptimes.sh @@ -24,4 +24,4 @@ echo "Uptimes:" column --table -R 2 -s "~" # ^ We use the column command to align things nicely: # -R 2 aligns the second column to the right -# -s ~ will split on occurences of ~ +# -s ~ will split on occurrences of ~ diff --git a/scripts/dns/delete-all-records.sh b/scripts/dns/delete-all-records.sh new file mode 100644 index 0000000..7da8d74 --- /dev/null +++ b/scripts/dns/delete-all-records.sh @@ -0,0 +1,10 @@ +zoneid=$1 +bearer=$2 +# Taken from https://developers.cloudflare.com/dns/zone-setups/troubleshooting/delete-all-records/ +curl --silent "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records?per_page=50000" \ +--header "Authorization: Bearer $bearer" \ +| jq --raw-output '.result[].id' | while read id +do + curl --silent --request DELETE "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records/$id" \ +--header "Authorization: Bearer $bearer" +done diff --git a/scripts/dns/dns.txt b/scripts/dns/dns.txt new file mode 100644 index 0000000..128c818 --- /dev/null +++ b/scripts/dns/dns.txt @@ -0,0 +1,58 @@ +$ORIGIN moonythm.dev. ; designates default origin +$TTL 600 ; expiration time in ms + +; ========================================================================================== +; Main dns records + +; Actual (internal, mostly) IPs +lapetus.moonythm.dev IN A 100.93.136.59 +lapetus.moonythm.dev IN AAAA fd7a:115c:a1e0::e75d:883b + +; lapetus services +actual IN CNAME lapetus.moonythm.dev. +api.intray IN CNAME lapetus.moonythm.dev. +api.smos IN CNAME lapetus.moonythm.dev. +cal IN CNAME lapetus.moonythm.dev. +docs.smos IN CNAME lapetus.moonythm.dev. +grafana IN CNAME lapetus.moonythm.dev. +intray IN CNAME lapetus.moonythm.dev. +irc IN CNAME lapetus.moonythm.dev. +lab IN CNAME lapetus.moonythm.dev. +lapetus.syncthing IN CNAME lapetus.moonythm.dev. +media IN CNAME lapetus.moonythm.dev. +prometheus IN CNAME lapetus.moonythm.dev. +qbit IN CNAME lapetus.moonythm.dev. +redlib IN CNAME lapetus.moonythm.dev. +rss IN CNAME lapetus.moonythm.dev. +search IN CNAME lapetus.moonythm.dev. +smos IN CNAME lapetus.moonythm.dev. +warden IN CNAME lapetus.moonythm.dev. +yt IN CNAME lapetus.moonythm.dev. + +*.irc IN CNAME irc.moonythm.dev. +diptime IN CNAME real.lapetus.moonythm.dev. + +; ========================================================================================== +; Migadu mail setup + +; Mail MX records +orbit.moonythm.dev IN MX 10 aspmx1.migadu.com. +orbit.moonythm.dev IN MX 20 aspmx2.migadu.com. +moonythm.dev IN MX 10 aspmx1.migadu.com. +moonythm.dev IN MX 20 aspmx2.migadu.com. + +; Mail CNAME records +key1._domainkey IN CNAME key1.moonythm.dev._domainkey.migadu.com. +key2._domainkey IN CNAME key2.moonythm.dev._domainkey.migadu.com. +key3._domainkey IN CNAME key3.moonythm.dev._domainkey.migadu.com. +key1._domainkey.orbit IN CNAME key1.orbit.moonythm.dev._domainkey.migadu.com. +key2._domainkey.orbit IN CNAME key2.orbit.moonythm.dev._domainkey.migadu.com. +key3._domainkey.orbit IN CNAME key3.orbit.moonythm.dev._domainkey.migadu.com. + +; Other mail stuff +_dmarc.moonythm.dev IN TXT "v=DMARC1; p=quarantine;" +_dmarc.orbit.moonythm.dev IN TXT "v=DMARC1; p=quarantine;" +moonythm.dev IN TXT "hosted-email-verify=kfkhyexd" +moonythm.dev IN TXT "v=spf1 include:spf.migadu.com -all" +orbit.moonythm.dev IN TXT "hosted-email-verify=24s7lnum" +orbit.moonythm.dev IN TXT "v=spf1 include:spf.migadu.com -all"