summaryrefslogtreecommitdiff
path: root/modules/xnet/net/dns.nix
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2025-04-02 21:59:20 -0400
committerKleidi Bujari <mail@4kb.net>2025-04-02 21:59:20 -0400
commit09c2b6de63a6ff35348fcb2c2eb57b974f0a8a52 (patch)
treebd8f1d3a51f12cd98764ae572b00f0b32de62644 /modules/xnet/net/dns.nix
parentb1738c105de3bc0ba7cd27f68c9eb146439a0964 (diff)
downloaddepot-09c2b6de63a6ff35348fcb2c2eb57b974f0a8a52.tar.gz
depot-09c2b6de63a6ff35348fcb2c2eb57b974f0a8a52.tar.bz2
depot-09c2b6de63a6ff35348fcb2c2eb57b974f0a8a52.zip
automate project structure
Diffstat (limited to 'modules/xnet/net/dns.nix')
-rw-r--r--modules/xnet/net/dns.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/modules/xnet/net/dns.nix b/modules/xnet/net/dns.nix
new file mode 100644
index 0000000..0632fa9
--- /dev/null
+++ b/modules/xnet/net/dns.nix
@@ -0,0 +1,38 @@
+{ lib, ... }:
+let
+ inherit (lib)
+ mkDefault
+ ;
+
+ quad9 = [
+ "9.9.9.9#dns.quad9.net"
+ "149.112.112.112#dns.quad9.net"
+ "2620:fe::fe#dns.quad9.net"
+ "2620:fe::9#dns.quad9.net"
+ ];
+
+ cloudflare = [
+ "1.1.1.1#one.one.one.one"
+ "1.0.0.1#one.one.one.one"
+ "2606:4700:4700::1111#one.one.one.one"
+ "2606:4700:4700::1001#one.one.one.one"
+ ];
+in
+{
+
+ networking.nameservers = mkDefault quad9;
+
+ services.resolved = {
+ enable = true;
+ llmnr = "false";
+ dnssec = "false";
+ dnsovertls = mkDefault "opportunistic";
+ fallbackDns = quad9 ++ cloudflare;
+ extraConfig = ''
+ MulticastDNS=yes
+ '';
+ };
+
+ # Allow mDNS resolution
+ networking.firewall.allowedTCPPorts = [ 5353 ];
+}