From a9373e58dddd80d012e1bdd040d70d1ad3912bda Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 7 Aug 2024 16:30:45 +0700 Subject: [PATCH] bareksa: fix DNS resolution for bareksa.local domain when openvpn is connected --- system/modules/networking.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/system/modules/networking.nix b/system/modules/networking.nix index d8e87c3..ca7f8f1 100644 --- a/system/modules/networking.nix +++ b/system/modules/networking.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, pkgs, ... }: { networking.networkmanager.enable = true; networking.extraHosts = '' @@ -16,4 +16,16 @@ allowedTCPPorts = cfg.allowedTCPPorts; allowedUDPPorts = [ 53 ]; }; + + services.resolved = { + enable = true; + }; + + environment.etc."systemd/resolved.conf.d/10-bareksa.conf".source = (pkgs.formats.ini { }).generate "10-bareksa.conf" { + Resolve = { + # This dns server is only available when VPN is connected. + DNS = "192.168.3.215"; + Domains = "~bareksa.local"; + }; + }; }