maxwell/nameserver.nix

52 lines
1.1 KiB
Nix
Raw Normal View History

2023-08-15 16:21:59 +02:00
{ config, lib, ... }:
2020-10-20 01:11:28 +02:00
# Setup:
# pdns-recursor on localhost:54
# dnsdist on port 53 (DNS)
2024-07-04 11:21:51 +02:00
# ncdns for Namecoin bit. zone resolution
2020-10-20 01:11:28 +02:00
{
# Recursive DNS resolver
2023-08-15 16:21:59 +02:00
services.pdns-recursor =
{ enable = true;
# Configures the bit. zone
resolveNamecoin = true;
dns.port = 54;
2023-08-15 16:21:59 +02:00
};
2020-10-20 01:11:28 +02:00
2024-07-04 11:21:51 +02:00
# Public DNS resolver
services.dnsdist =
{ enable = true;
extraConfig = ''
-- Listen on IPv6 and IPv4
setLocal("[::]:53"); addLocal("0.0.0.0:53")
-- Allow everything
setACL({"0.0.0.0/0", "::/0"})
-- Set upstream resolver
newServer({address="[::1]:54", name="pdns"})
2024-07-04 11:21:51 +02:00
'';
};
2020-10-20 01:11:28 +02:00
# Namecoin resolver
2023-08-15 16:21:59 +02:00
services.ncdns =
{ enable = true;
# This is currently broken, see ncdns issue:
# https://github.com/namecoin/ncdns/issues/127
dnssec.enable = false;
};
2020-10-20 01:11:28 +02:00
# Namecoin daemon with RPC server
2023-08-15 16:21:59 +02:00
services.namecoind =
{ enable = true;
# This are used by the resolver (ncdns)
# to query the blockchain.
rpc.user = config.secrets.namecoin.user;
rpc.password = config.secrets.namecoin.password;
};
2020-10-20 01:11:28 +02:00
2021-12-21 00:31:25 +01:00
users.users.namecoin.group = "namecoin";
2020-10-20 01:11:28 +02:00
}