dns: serial of therecord is now updated dynamically
This commit is contained in:
parent
6119c9a88a
commit
3d15446d63
1 changed files with 19 additions and 13 deletions
|
@ -1,6 +1,11 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.skynet_dns;
|
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 {
|
in {
|
||||||
options = {
|
options = {
|
||||||
skynet_dns = {
|
skynet_dns = {
|
||||||
|
@ -150,20 +155,21 @@ in {
|
||||||
$TTL 60 ; 1 minute
|
$TTL 60 ; 1 minute
|
||||||
; hostmaster@skynet.ie is an email address that recieves stuff related to dns
|
; hostmaster@skynet.ie is an email address that recieves stuff related to dns
|
||||||
@ IN SOA ${cfg.own.nameserver}.skynet.ie. hostmaster.skynet.ie. (
|
@ IN SOA ${cfg.own.nameserver}.skynet.ie. hostmaster.skynet.ie. (
|
||||||
2023011701 ; Serial (YYYYMMDDCC)
|
; Serial (YYYYMMDDCC) this has to be updated for each time the record is updated
|
||||||
600 ; Refresh (10 minutes)
|
${current_date}
|
||||||
300 ; Retry (5 minutes)
|
600 ; Refresh (10 minutes)
|
||||||
2419200 ; Expire (4 weeks)
|
300 ; Retry (5 minutes)
|
||||||
3600 ; Minimum (1 hour)
|
2419200 ; Expire (4 weeks)
|
||||||
)
|
3600 ; Minimum (1 hour)
|
||||||
NS ns1.skynet.ie.
|
)
|
||||||
NS ns2.skynet.ie.
|
NS ns1.skynet.ie.
|
||||||
; @ stands for teh root domain so teh A record below is where skynet.ie points to
|
NS ns2.skynet.ie.
|
||||||
A 193.1.99.76
|
; @ stands for teh root domain so teh A record below is where skynet.ie points to
|
||||||
MX 5 mail.skynet.ie.
|
A 193.1.99.76
|
||||||
|
MX 5 mail.skynet.ie.
|
||||||
|
|
||||||
; can have multiple mailserves
|
; can have multiple mailserves
|
||||||
;MX 20 mail2.skynet.ie.
|
;MX 20 mail2.skynet.ie.
|
||||||
|
|
||||||
|
|
||||||
; ------------------------------------------
|
; ------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue