From 1a767269445960da0c3bd0c93dccebe7b0dfd8ec Mon Sep 17 00:00:00 2001
From: sinanmohd <sinan@sinanmohd.com>
Date: Fri, 28 Feb 2025 22:16:39 +0530
Subject: kay/ddns: make ipv4 static

---
 os/kay/modules/dns/ddns.nix           | 70 ++++++++++++++---------------------
 os/kay/modules/dns/sinanmohd.com.zone |  4 +-
 2 files changed, 29 insertions(+), 45 deletions(-)

(limited to 'os/kay')

diff --git a/os/kay/modules/dns/ddns.nix b/os/kay/modules/dns/ddns.nix
index e6e417a..4a8fe5d 100644
--- a/os/kay/modules/dns/ddns.nix
+++ b/os/kay/modules/dns/ddns.nix
@@ -1,44 +1,28 @@
-{ pkgs,  ... }: {
-   services.pppd.script = {
-      "02-ddns-ipv4" = {
-         runtimeInputs = with pkgs; [ coreutils knot-dns ];
-         type = "ip-up";
-
-         text = ''
-            cat <<- EOF | knsupdate
-                    server  2001:470:ee65::1
-                    zone    sinanmohd.com.
-
-                    update  delete  sinanmohd.com.       A
-                    update  add     sinanmohd.com.       180     A       $4
-
-                    update  delete  mail.sinanmohd.com.  A
-                    update  add     mail.sinanmohd.com.  180     A       $4
-
-                    send
-            EOF
-         '';
-       };
-
-      "02-ddns-ipv6" = {
-         runtimeInputs = with pkgs; [ coreutils knot-dns iproute2 gnugrep ];
-         type = "ipv6-up";
-
-         text = ''
-            while ! ipv6="$(ip -6 addr show dev "$1" scope global | grep -o '[0-9a-f:]*::1')"; do
-               sleep 0.2
-            done
-
-            cat <<- EOF | knsupdate
-                    server  2001:470:ee65::1
-                    zone    sinanmohd.com.
-
-                    update  delete  sinanmohd.com.  AAAA
-                    update  add     sinanmohd.com.  180     AAAA    $ipv6
-
-                    send
-            EOF
-         '';
-       };
-    };
+{ pkgs, ... }:
+{
+  services.pppd.script."02-ddns-ipv6" = {
+    type = "ipv6-up";
+    runtimeInputs = with pkgs; [
+      coreutils
+      knot-dns
+      iproute2
+      gnugrep
+    ];
+
+    text = ''
+      while ! ipv6="$(ip -6 addr show dev "$1" scope global | grep -o '[0-9a-f:]*::1')"; do
+         sleep 0.2
+      done
+
+      cat <<- EOF | knsupdate
+              server  2001:470:ee65::1
+              zone    sinanmohd.com.
+
+              update  delete  sinanmohd.com.  AAAA
+              update  add     sinanmohd.com.  180     AAAA    $ipv6
+
+              send
+      EOF
+    '';
+  };
 }
diff --git a/os/kay/modules/dns/sinanmohd.com.zone b/os/kay/modules/dns/sinanmohd.com.zone
index e0fba5b..a1756de 100644
--- a/os/kay/modules/dns/sinanmohd.com.zone
+++ b/os/kay/modules/dns/sinanmohd.com.zone
@@ -2,7 +2,7 @@ $ORIGIN sinanmohd.com.
 $TTL 2d
 
 @	IN	SOA	ns1	hostmaster (
-			2025022804 ; serial
+			2025022808 ; serial
 			2h         ; refresh
 			5m         ; retry
 			1d         ; expire
@@ -27,7 +27,7 @@ rsa._domainkey		IN	TXT	"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCg
 
 ns1	IN	AAAA	2001:470:ee65::1
 
-mail 30	IN	A	127.0.0.1
+mail 30	IN	A	137.59.84.126
 mail	IN	AAAA	2001:470:ee65::1337
 smtp	IN	CNAME	@
 imap	IN	CNAME	@
-- 
cgit v1.2.3