feat: first nameserver set up

This commit is contained in:
silver 2023-01-18 02:06:08 +00:00
parent f3a3768f92
commit 8db9529449
4 changed files with 34 additions and 9 deletions

View file

@ -39,8 +39,8 @@ in {
forwarders = [ forwarders = [
# these were in old config file # these were in old config file
"193.1.100.130" #"193.1.100.130"
"193.1.100.131" #"193.1.100.131"
]; ];
zones = { zones = {
@ -62,10 +62,11 @@ in {
extraConfig = ""; extraConfig = "";
# really wish teh nixos config didnt use master/slave # really wish teh nixos config didnt use master/slave
master = true; master = true;
masters = [ ];
slaves = [ ]; slaves = [ ];
# need to write this to a file
file = '' file = pkgs.writeText "dns_zone_skynet"
# no leading whitespace for first line
''
$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 ns1.skynet.ie. hostmaster.skynet.ie. ( @ IN SOA ns1.skynet.ie. hostmaster.skynet.ie. (
@ -91,7 +92,7 @@ in {
; External addresses ; External addresses
; ------------------------------------------ ; ------------------------------------------
${lib.strings.concatMapStrings (x: x + "\n ") cfg.records.external} ${lib.strings.concatMapStrings (x: x + "\n") cfg.records.external}
; this is fixed for now ; this is fixed for now
@ -106,7 +107,7 @@ in {
; cname's ; cname's
; ------------------------------------------ ; ------------------------------------------
${lib.strings.concatMapStrings (x: x + "\n ") cfg.records.cname} ${lib.strings.concatMapStrings (x: x + "\n") cfg.records.cname}
''; '';
}; };

View file

@ -78,7 +78,11 @@
*/ */
#test02 = import ./machines/test02.nix; # firewall machiene
agentjones = import ./machines/agentjones.nix;
# ns1
vendetta = import ./machines/vendetta.nix;
}; };
}; };

View file

@ -19,6 +19,7 @@ in {
imports = [ imports = [
# applications for this particular server # applications for this particular server
../applications/firewall.nix ../applications/firewall.nix
../applications/dns.nix
]; ];
deployment = { deployment = {
@ -27,6 +28,13 @@ in {
targetUser = "root"; targetUser = "root";
}; };
skynet_dns.records = {
external = [
"agentjones A ${ip_pub}"
];
cname = [];
};
# this has to be defined for any physical servers # this has to be defined for any physical servers
# vms are defined by teh vm host # vms are defined by teh vm host
networking.interfaces = { networking.interfaces = {

View file

@ -16,12 +16,17 @@ let
ip_pub = "192.168.1.157"; ip_pub = "192.168.1.157";
ip_priv = "172.20.20.3"; ip_priv = "172.20.20.3";
# hostname = "vendetta.skynet.ie"; # hostname = "vendetta.skynet.ie";
hostname = "test01.home.brendan.ie"; hostname = "192.168.1.157";
# this server will have to have dns records # this server will have to have dns records
own = { own = {
external = [ external = [
"vendetta A ${ip_pub}" "vendetta A ${ip_pub}"
"ns1 A ${ip_pub}"
# needs this, temporally
"ns2 A ${ip_pub}"
"mail A ${ip_pub}"
]; ];
cname = [ cname = [
#"misc CNAME vendetta" #"misc CNAME vendetta"
@ -39,6 +44,13 @@ in {
targetUser = "root"; targetUser = "root";
}; };
networking = {
firewall = {
allowedTCPPorts = [22 53];
allowedUDPPorts = [53];
};
};
skynet_dns = { skynet_dns = {
enable = true; enable = true;