From 8574f0f177c004031a4282d121931caab62158ad Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 3 Nov 2017 13:29:14 +0100 Subject: ma lancache-dns: add storage server names --- makefu/2configs/lanparty/lancache-dns.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/lanparty/lancache-dns.nix b/makefu/2configs/lanparty/lancache-dns.nix index 4b4ebf0a0..f03fe8773 100644 --- a/makefu/2configs/lanparty/lancache-dns.nix +++ b/makefu/2configs/lanparty/lancache-dns.nix @@ -21,6 +21,13 @@ let stateDir = "/var/lib/unbound"; user = "unbound"; upstream-server = "8.8.8.8"; + local_ip = "192.168.1.10"; + extra-config = pkgs.writeText "local.conf" '' + server: + local-data: "piratebox. A ${local-ip}" + local-data: "store. A ${local-ip}" + local-data: "share. A ${local-ip}" + ''; in { services.unbound = { enable = true; @@ -29,6 +36,7 @@ in { forwardAddresses = [ upstream-server ]; extraConfig = '' include: "${stateDir}/lancache/*.conf" + include: "${extra-config}" ''; }; services.dnscrypt-proxy.enable = lib.mkForce false; @@ -42,7 +50,8 @@ in { path = [ pkgs.gawk pkgs.iproute pkgs.gnused ]; script = '' set -xeu - current_ip=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') + # current_ip=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') + current_ip=${local_ip} old_ip=10.1.1.250 mkdir -p ${stateDir} rm -rvf ${stateDir}/lancache -- cgit v1.2.3