summaryrefslogtreecommitdiff
path: root/hosts/ahmed/dns
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/ahmed/dns')
-rw-r--r--hosts/ahmed/dns/default.nix31
1 files changed, 31 insertions, 0 deletions
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];
+ };
+}