How can i edit Unbound config file

I want to know how to edit Unbound config file

  1. I installed Unbound.

/etc/nixos/configuration.nix

services = {
  unbound = {
      enable = true;
  };
};
  1. I edited Unbound config file

/var/lib/unbound/unbound.conf

server:
  directory: "/var/lib/unbound"
  username: unbound
  chroot: "/var/lib/unbound"
  pidfile: ""
  interface: 127.0.0.1
  interface: ::1
  access-control: 127.0.0.0/24 allow
  auto-trust-anchor-file: /var/lib/unbound/root.key
include: "/etc/unbound/unbound.conf.d/*.conf"
server:
  directory: "/var/lib/unbound"
  username: unbound
  chroot: "/var/lib/unbound"
  pidfile: ""
  interface: 127.0.0.1
  interface: ::1
  access-control: 127.0.0.0/24 allow
  auto-trust-anchor-file: /var/lib/unbound/root.key
  1. I restarted Unbound
systemctl restart unbound

but, it doesnt work.
Could you tell me how to edit unbound config file ?

Perhaps you can use the other options that are available for services.unbound? Especially extraConfig is usually quite useful when dealing with configuration.

https://nixos.org/nixos/options.html#unbound

1 Like

Thank you very much to let me know this nice webpage.
I did not that there was a page like this.
https://nixos.org/nixos/options.html#unbound

it will help me.

1 Like