Systemd/resolved: Difference between revisions

From NixOS Wiki
Onny (talk | contribs)
Onny (talk | contribs)
No edit summary
 
Line 8: Line 8:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
networking.nameservers = [
  "1.1.1.1"
  "1.0.0.1"
];
services.resolved = {
services.resolved = {
   enable = true;
   enable = true;

Latest revision as of 18:53, 14 May 2024

systemd-resolved is a systemd service that provides network name resolution to local applications via a D-Bus interface, the resolve NSS service (nss-resolve(8)), and a local DNS stub listener on 127.0.0.53. See systemd-resolved(8) for the usage.

Configuration

The following configuration configures resolved daemon to use the public DNS resolver provided by Cloudflare. DNSSEC and DNS-over-TLS is enabled for authenticity and encryption.

networking.nameservers = [
  "1.1.1.1"
  "1.0.0.1"
];

services.resolved = {
  enable = true;
  dnssec = "true";
  domains = [ "~." ];
  fallbackDns = [
    "1.1.1.1"
    "1.0.0.1"
  ];
  dnsovertls = "true";
};