From 2606d395fce36e77c542ace1f0f318a57130a522 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sat, 3 Jun 2017 11:59:34 +0200 Subject: [PATCH] dnschain: allow different bind and external addresses --- nixos/modules/services/networking/dnschain.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/networking/dnschain.nix b/nixos/modules/services/networking/dnschain.nix index b6492996057..ab7bbb15ad4 100644 --- a/nixos/modules/services/networking/dnschain.nix +++ b/nixos/modules/services/networking/dnschain.nix @@ -17,7 +17,7 @@ let host = ${cfg.dns.address} port = ${toString cfg.dns.port} oldDNSMethod = NO_OLD_DNS - externalIP = ${cfg.dns.address} + externalIP = ${cfg.dns.externalAddress} [http] host = ${cfg.api.hostname} @@ -47,8 +47,18 @@ in type = types.str; default = "127.0.0.1"; description = '' - The IP address that will be used to reach this machine. - Leave this unchanged if you do not wish to directly expose the DNSChain resolver. + The IP address the DNSChain resolver will bind to. + Leave this unchanged if you do not wish to directly expose the resolver. + ''; + }; + + dns.externalAddress = mkOption { + type = types.str; + default = cfg.dns.address; + description = '' + The IP address used by clients to reach the resolver and the value of + the namecoin.dns record. Set this in case the bind address + is not the actual IP address (e.g. the machine is behind a NAT). ''; };