Enable static dns server for iwd standalone

If your using iwd standalone (without NetworkManager and dhcpcd) then you might have tried networking.nameservers = [ "1.1.1.1" ];, but this does not work :frowning:

If you cat /etc/resolv.conf then you would see

nameserver 1.1.1.1
nameserver {{ some random dns server here }}

This is because your resolvconf.service has automatically appended a dynamic dns to /etc/resolv.conf. The solution to it is to add to configuration.nix

networking.wireless.iwd.settings.Network.NameResolvingService="none";
resolvconf.enable=false;

resolvconf is enabled by default when you have a /etc/resolv.conf it seems.m

3 Likes

How are you configuring iwd out of interest? It may be worth adding this to the upstream module.

1 Like