From 21d585edc2c5ec5d182a3e3fe5fa170046889b40 Mon Sep 17 00:00:00 2001 From: lbehm Date: Sat, 20 Apr 2024 20:50:26 +0200 Subject: [PATCH] nsd: adding captive portal dns redirect --- Makefile | 1 + nsd/nsd.conf.d/server.conf | 4 ++++ nsd/zones/captive-portals | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 nsd/zones/captive-portals diff --git a/Makefile b/Makefile index d53a66a..167b215 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ install: @echo setup nsd dns server install -o0 -g0 nsd/nsd.conf.d/* /etc/nsd/nsd.conf.d/ install -o0 -g0 nsd/zones/* /etc/nsd/zones/ + systemctl restart nsd.service @echo install nginx rm -f /etc/nginx/sites-enabled/default diff --git a/nsd/nsd.conf.d/server.conf b/nsd/nsd.conf.d/server.conf index 7196b88..a8562c8 100644 --- a/nsd/nsd.conf.d/server.conf +++ b/nsd/nsd.conf.d/server.conf @@ -9,3 +9,7 @@ server: zone: name: kraut.space zonefile: kraut.space + +zone: + name: . + zonefile: captive-portals diff --git a/nsd/zones/captive-portals b/nsd/zones/captive-portals new file mode 100644 index 0000000..bde95ed --- /dev/null +++ b/nsd/zones/captive-portals @@ -0,0 +1,24 @@ +$ORIGIN . ; default zone domain +$TTL 2 ; default time to live + +@ IN SOA doorito.tuer.kraut.space. office.kraut.space. ( + 2404182124 ; serial number + 60 ; Refresh + 7200 ; Retry + 60 ; Expire + 60 ; Min TTL + ) + + IN NS doorito.tuer.kraut.space. + +; Android +connectivitycheck.gstatic.com. IN A 192.168.1.1 +clients3.google.com. IN A 192.168.1.1 +; Firefox +detectportal.firefox.com. IN A 192.168.1.1 +; macOS / iOS +captive.apple.com. IN A 192.168.1.1 +; Windows +www.msftncsi.com. IN A 192.168.1.1 +www.msftconnecttest.com. IN A 192.168.1.1 +dns.msftncsi.com. IN A 192.168.1.1