about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2017-05-06 13:56:10 +0100
committerGitHub <noreply@github.com>2017-05-06 13:56:10 +0100
commitdc2fc5ed575f162624984437ade816b96316f9ab (patch)
treecb26a12533ff8971f5380c898a38aec8f55294b3 /nixos
parent6ef9875edb5160d8e447d3acd06ffc14c23a9052 (diff)
parente7203cb03d981220354cb01216f283e176139c20 (diff)
downloadnixlib-dc2fc5ed575f162624984437ade816b96316f9ab.tar
nixlib-dc2fc5ed575f162624984437ade816b96316f9ab.tar.gz
nixlib-dc2fc5ed575f162624984437ade816b96316f9ab.tar.bz2
nixlib-dc2fc5ed575f162624984437ade816b96316f9ab.tar.lz
nixlib-dc2fc5ed575f162624984437ade816b96316f9ab.tar.xz
nixlib-dc2fc5ed575f162624984437ade816b96316f9ab.tar.zst
nixlib-dc2fc5ed575f162624984437ade816b96316f9ab.zip
Merge pull request #25495 from michalpalka/xen-forward-dns
xen service: Forward DNS queries from Xen guests
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/virtualisation/xen-dom0.nix18
1 files changed, 15 insertions, 3 deletions
diff --git a/nixos/modules/virtualisation/xen-dom0.nix b/nixos/modules/virtualisation/xen-dom0.nix
index 785cf2cc3443..7df2df6ef8a8 100644
--- a/nixos/modules/virtualisation/xen-dom0.nix
+++ b/nixos/modules/virtualisation/xen-dom0.nix
@@ -100,6 +100,16 @@ in
             subnet.
           '';
         };
+
+        forwardDns = mkOption {
+          default = false;
+          description = ''
+            If set to <literal>true</literal>, the DNS queries from the
+            hosts connected to the bridge will be forwarded to the DNS
+            servers specified in /etc/resolv.conf .
+            '';
+        };
+
       };
 
     virtualisation.xen.stored =
@@ -359,7 +369,6 @@ in
         interface=${cfg.bridge.name}
         except-interface=lo
         bind-interfaces
-        auth-server=dns.xen.local,${cfg.bridge.name}
         auth-zone=xen.local,$XEN_BRIDGE_NETWORK_ADDRESS/${toString cfg.bridge.prefixLength}
         domain=xen.local
         addn-hosts=/var/run/xen/dnsmasq.hostsfile
@@ -367,8 +376,11 @@ in
         strict-order
         no-hosts
         bogus-priv
-        no-resolv
-        no-poll
+        ${optionalString (!cfg.bridge.forwardDns) ''
+          no-resolv
+          no-poll
+          auth-server=dns.xen.local,${cfg.bridge.name}
+        ''}
         filterwin2k
         clear-on-reload
         domain-needed