Resolvectl does not work - no service

When I run resolvectl I get this error.

Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

Is my configuration.nix incorrect? Below excert from that file.

  networking = {
    hostName = "myhost";
    wireless = {
      enable = true;
      interfaces = ["wlp2s0"];
      networks = {
        <NETWORK_NAME>.auth = ''
          key_mgmt=WPA-PSK
          psk="<PASSWORD>"
        '';
      };
    };
    useDHCP = false;
    interfaces.wlp2s0.useDHCP = true;
  };

How should I configure my networking correctly? So that I could use resolvectl; I would liket to query/modify my DNS config in runtime.

We do not use system-resolved by default for DNS. You have to enable it manually in your nixes config.

you could do this:

services.resolved.enable = true;
1 Like