After enabling service "resolved", I can't reach the internet from terminal

I added this to “/etc/nixos/configuration.nix”:

services = {
    openssh = {
    enable = true;
    passwordAuthentication = true;
    };
    avahi = {
       enable = true;
       publish = {
         enable = true;
         addresses = true;
         workstation = true;
      };
    };
    resolved = {
      enable = true;                                                                                                                                                                                                                                                                  
    };
};

I did this on two computers running nixos and now they can find each other on my local network. Great.

Only, from my terminal, there doesn’t seem to be internet connection. From my browser, everything works. But git fetch, nix run and so on act as if I were disconnected.

Any idea where to start?

Turn off avahi and see how the behavior changes.

Linux networking is complicated and confused with many different approaches stepping on each other. What is the rest of your nix network configuration?

My systems are configured using NetworkManager and resolved and almost no other network settings. This resolved.extraConfig may matter for you – particularly LLMNR=no

  services.resolved = {
    enable = true;
    extraConfig = ''
      LLMNR=no
      ReadEtcHosts=no
      DNSSEC=no
    '';
  };

I’ve used avahi in the past, but had problems with some tools conflicting (not avahi’s fault).

1 Like

Thanks for this, I’ve been trying to get resolved to resolve local domains so that I can access my network portal for 2h. Thank you pottering for thinking that was a good default.