diff options
Diffstat (limited to 'hosts/ahmed')
-rw-r--r-- | hosts/ahmed/configuration.nix | 1 | ||||
-rw-r--r-- | hosts/ahmed/dns/default.nix | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/hosts/ahmed/configuration.nix b/hosts/ahmed/configuration.nix index 25eb336..9bd394f 100644 --- a/hosts/ahmed/configuration.nix +++ b/hosts/ahmed/configuration.nix @@ -23,6 +23,7 @@ ./dyndns ./minecraft ./nginx + ./dns ]; # Create the main user. diff --git a/hosts/ahmed/dns/default.nix b/hosts/ahmed/dns/default.nix new file mode 100644 index 0000000..35360f7 --- /dev/null +++ b/hosts/ahmed/dns/default.nix @@ -0,0 +1,31 @@ +{metadata, ...}: { + services.dnscache = { + enable = true; + clientIps = [ + "192.168" # LAN + "127.0.0.1" # Local connections + ]; + + domainServers = { + "internal" = ["127.0.0.1"]; + }; + }; + + services.tinydns = { + enable = true; + + # We will only listen for internal queries from the DNS cache. + ip = "127.0.0.1"; + + data = '' + .internal:127.0.0.1:a + =ahmed.internal:${metadata.hosts.ahmed.ipAddress} + =muhammed.internal:${metadata.hosts.muhammed.ipAddress} + ''; + }; + + networking.firewall = { + allowedTCPPorts = [53]; + allowedUDPPorts = [53]; + }; +} |