dns: serial of therecord is now updated dynamically

This commit is contained in:
silver 2023-04-23 13:37:42 +01:00
parent 6119c9a88a
commit 3d15446d63

View file

@ -1,6 +1,11 @@
{ lib, pkgs, config, ... }:
let
cfg = config.skynet_dns;
# writes current date to a file
current_date_path = pkgs.runCommand "current_date" {} "date '+%Y%m%d%S' > $out";
# reads that date to a string
current_date = (lib.readFile current_date_path);
in {
options = {
skynet_dns = {
@ -150,20 +155,21 @@ in {
$TTL 60 ; 1 minute
; hostmaster@skynet.ie is an email address that recieves stuff related to dns
@ IN SOA ${cfg.own.nameserver}.skynet.ie. hostmaster.skynet.ie. (
2023011701 ; Serial (YYYYMMDDCC)
600 ; Refresh (10 minutes)
300 ; Retry (5 minutes)
2419200 ; Expire (4 weeks)
3600 ; Minimum (1 hour)
)
NS ns1.skynet.ie.
NS ns2.skynet.ie.
; @ stands for teh root domain so teh A record below is where skynet.ie points to
A 193.1.99.76
MX 5 mail.skynet.ie.
; Serial (YYYYMMDDCC) this has to be updated for each time the record is updated
${current_date}
600 ; Refresh (10 minutes)
300 ; Retry (5 minutes)
2419200 ; Expire (4 weeks)
3600 ; Minimum (1 hour)
)
NS ns1.skynet.ie.
NS ns2.skynet.ie.
; @ stands for teh root domain so teh A record below is where skynet.ie points to
A 193.1.99.76
MX 5 mail.skynet.ie.
; can have multiple mailserves
;MX 20 mail2.skynet.ie.
; can have multiple mailserves
;MX 20 mail2.skynet.ie.
; ------------------------------------------