diff --git a/dnsconfig.js b/dnsconfig.js index 6e12aea..6d6eb38 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -94,10 +94,8 @@ cnames("arirex.me", rexbox, [ "Enclosed@bin", "IT Tools@it", "Karakeep@karakeep", - "Matrix / Client@chat", - "Matrix / Server@matrix", - "Minecraft > Frantic@frantic.mc", - "Minecraft > The Furry Cult@thefurrycult.mc", + "Matrix > Client@chat", + "Matrix > Server@matrix", "Ntfy@ntfy", "OpenWebUI@ai", "Pocket ID@id", @@ -106,18 +104,12 @@ cnames("arirex.me", rexbox, [ ]); cnames("achl.fr", rexbox, [ - "Matrix / Client@chat", - "Matrix / Server@matrix", + "Matrix > Client@chat", + "Matrix > Server@matrix", ]); -D_EXTEND("arirex.me", - SRV("_minecraft._tcp.frantic.mc", 0, 0, 63548, "frantic.mc.arirex.me."), - SRV("_minecraft._udp.frantic.mc", 0, 0, 63548, "frantic.mc.arirex.me."), - - SRV("_minecraft._tcp.thefurrycult.mc", 0, 0, 54924, "thefurrycult.mc.arirex.me."), - SRV("_minecraft._udp.thefurrycult.mc", 0, 0, 54924, "thefurrycult.mc.arirex.me."), -); - +minecraft("Frantic", "frantic.mc", "arirex.me", 63548); +minecraft("The Furry Cult", "thefurrycult.mc", "arirex.me", 54924); /* -------------------------------------------------------------------------- *\ RexCloud Services @@ -162,6 +154,21 @@ function cnames(domain, target, records) { }); } +/** + * Create a Minecraft server subdomain with CNAME and SRV records + * @param {string} comment - Human-readable server name + * @param {string} subdomain - Subdomain for the server + * @param {string} domain - Domain to extend + * @param {number} port - Port the server listens on + */ +function minecraft(comment, subdomain, domain, port) { + var fqdn = subdomain + "." + domain + "."; + D_EXTEND(domain, + CNAME(subdomain, rexbox, CF_COMMENT("Minecraft > " + comment)), + SRV("_minecraft._tcp." + subdomain, 0, 0, port, fqdn, CF_COMMENT("Minecraft > " + comment)), + ); +} + /** * Generate ProtonMail DNS records (MX, SPF, DMARC, verification, DKIM) * @param {string} verification - ProtonMail verification token