about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2023-08-08 01:45:05 +0900
committerNguyễn Gia Phong <cnx@loang.net>2023-08-08 01:45:17 +0900
commita15bec7fd641fc896aa5552b191c15180082e12f (patch)
tree331c8c52176c180d2618cace06632d8332ae6596
parent1564da721dddc5ba987017d6aa20f08286a35639 (diff)
downloaddotfiles-a15bec7fd641fc896aa5552b191c15180082e12f.tar.gz
Cache DNS on laptop
-rw-r--r--nix/configuration.nix44
1 files changed, 27 insertions, 17 deletions
diff --git a/nix/configuration.nix b/nix/configuration.nix
index 83e0682..284a588 100644
--- a/nix/configuration.nix
+++ b/nix/configuration.nix
@@ -23,21 +23,7 @@
 
   networking = {
     hostName = "nix";
-    hosts = let
-      loang = [
-        "danh.loang.net" "tin.loang.net" "than.loang.net" "xem.loang.net"
-        "cnx.gdn" "px.cnx.gdn" "src.cnx.gdn"
-      ];
-    in {
-      "37.205.11.127" = loang;
-      "2a03:3b40:100::1:2" = loang;
-    };
-    nameservers = [
-      # ns4.any.dns.opennic.glue
-      "134.195.4.2"
-      # ns4.ca.us.dns.opennic.glue
-      "147.182.243.49"
-    ];
+    nameservers = [ "127.0.0.1" "::" ];
     networkmanager = {
       dns = "none";
       enable = true;
@@ -134,8 +120,8 @@
 
   environment = {
     etc."resolv.conf".text = ''
-      nameserver 134.195.4.2
-      nameserver 147.182.243.49
+      nameserver 127.0.0.1
+      nameserver ::
       options edns0
     '';
     localBinInPath = true;
@@ -165,6 +151,30 @@
       pulse.enable = true;
     };
 
+    smartdns = {
+      enable = true;
+      settings.server = [
+        "37.252.191.197" "2a00:63c1:10:197::2" # ns1.at
+        "103.1.206.179" "2400:c400:1002:11:fed:bee0:4433:6fb0" # ns2.au
+        "168.138.8.38" "2603:c023:c002:f4aa:a208:5df4:ee55:b70a" # ns4.au
+        "168.138.12.137" "2603:c023:c002:f4aa:9e63:198d:9c4:cced" # ns5.au
+        "137.220.55.93" "2001:19f0:b001:379:5400:3ff:fe68:1cc6" # ns1.ca
+        "94.247.43.254" "2a00:f826:8:1::254" # ns7.de
+        "195.10.195.195" "2a00:f826:8:2::195" # ns8.de
+        "51.254.162.59" "2001:41d0:303:3adf:205::" # ns9.de
+        "217.160.70.42" "2001:8d8:1801:86e7::1" # ns13.de
+        "178.254.22.166" "2a00:6800:3:4bd::1" # ns16.de
+        "81.169.136.222" "2a01:238:4231:5200::1" # ns18.de
+        "94.16.114.254" "2a03:4000:28:365::1" # ns28.de
+        "194.36.144.87" "2a03:4000:4d:c92:88c0:96ff:fec6:b9d" # ns29.de
+        "195.10.195.195" "2a00:f826:8:2::195" # ns31.de
+        "94.247.43.254" "2a00:f826:8:1::254" # ns8.he.de
+        "185.181.61.24" "2a03:94e0:1804::1" # ns1.no
+        "104.248.14.193" "2604:a880:800:10::92e:d001" # ns2.nj.us
+        "168.235.111.72" "2604:180:f3::132" # ns2.ny.us
+      ]; # dns.opennic.glue
+    };
+
     udisks2.enable = true;
   };