feat: generate the zones directly from teh dns records
This commit is contained in:
parent
2a8a7cc7f4
commit
454e58b085
2 changed files with 107 additions and 81 deletions
|
@ -14,7 +14,7 @@
|
|||
# this gets a list of all domains we have records for
|
||||
domains = lib.lists.naturalSort (
|
||||
lib.lists.unique (
|
||||
lib.lists.forEach records (record: record.domain)
|
||||
lib.lists.forEach records (x: x.domain)
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -76,8 +76,8 @@
|
|||
get_config_file = (
|
||||
domain: ''
|
||||
$TTL 60 ; 1 minute
|
||||
; hostmaster@${domain} is an email address that recieves stuff related to dns
|
||||
@ IN SOA ${nameserver}.${domain}. hostmaster.${domain}. (
|
||||
; hostmaster@skynet.ie is an email address that recieves stuff related to dns
|
||||
@ IN SOA ${nameserver}.skynet.ie. hostmaster.skynet.ie. (
|
||||
; Serial (YYYYMMDDCC) this has to be updated for each time the record is updated
|
||||
${current_date}
|
||||
600 ; Refresh (10 minutes)
|
||||
|
@ -87,8 +87,8 @@
|
|||
)
|
||||
|
||||
; @ stands for teh root domain so teh A record below is where ${domain} points to
|
||||
@ NS ns1.${domain}.
|
||||
@ NS ns2.${domain}.
|
||||
@ NS ns1.skynet.ie.
|
||||
@ NS ns2.skynet.ie.
|
||||
|
||||
; ------------------------------------------
|
||||
; Server Names (A Records)
|
||||
|
@ -274,6 +274,7 @@
|
|||
details_records
|
||||
++ [
|
||||
{
|
||||
domain = "skynet.ie";
|
||||
record = "ns1";
|
||||
r_type = "A";
|
||||
value = details_server.ip;
|
||||
|
@ -284,6 +285,7 @@
|
|||
details_records
|
||||
++ [
|
||||
{
|
||||
domain = "skynet.ie";
|
||||
record = "ns2";
|
||||
r_type = "A";
|
||||
value = details_server.ip;
|
||||
|
@ -351,13 +353,14 @@ in {
|
|||
"ip daddr ${cfg.server.ip} udp dport 53 counter packets 0 bytes 0 accept"
|
||||
];
|
||||
|
||||
services.bind.zones =
|
||||
(create_entry_zone "csn.ul.ie")
|
||||
// (create_entry_zone "skynet.ie")
|
||||
// (create_entry_zone "ulcompsoc.ie")
|
||||
// (create_entry_zone "64-64.99.1.193.in-addr.arpa")
|
||||
// (create_entry_zone "conradcollins.net")
|
||||
// (create_entry_zone "edelharty.net");
|
||||
services.bind.zones = lib.attrsets.mergeAttrsList (
|
||||
# uses teh domains lsited in teh records
|
||||
(lib.lists.forEach domains (domain: (create_entry_zone domain)))
|
||||
# we have to do a reverse dns
|
||||
++ [
|
||||
(create_entry_zone "64-64.99.1.193.in-addr.arpa")
|
||||
]
|
||||
);
|
||||
|
||||
environment.etc =
|
||||
(create_entry_etc "csn.ul.ie" "owned")
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
};
|
||||
|
||||
config = {
|
||||
skynet.records = [
|
||||
skynet.records =
|
||||
[
|
||||
{
|
||||
record = "optimus";
|
||||
r_type = "A";
|
||||
|
@ -78,6 +79,28 @@
|
|||
r_type = "SRV";
|
||||
value = "0 10 25519 minecraft.phildeb.games.skynet.ie.";
|
||||
}
|
||||
]
|
||||
# non skynet domains
|
||||
++ [
|
||||
{
|
||||
domain = "conradcollins.net";
|
||||
record = "www";
|
||||
r_type = "CNAME";
|
||||
value = "skynet.skynet.ie.";
|
||||
}
|
||||
|
||||
{
|
||||
domain = "edelharty.net";
|
||||
record = "www";
|
||||
r_type = "CNAME";
|
||||
value = "skynet.skynet.ie.";
|
||||
}
|
||||
{
|
||||
domain = "damienconroy.com";
|
||||
record = "www";
|
||||
r_type = "CNAME";
|
||||
value = "skynet.skynet.ie.";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue