Networking: Difference between revisions

imported>Dafitt
mNo edit summary
imported>Writer
use more idiomatic networking.hosts and IP net designated for examples
Line 26: Line 26:
To edit <code>/etc/hosts</code> just add something like this to your <code>configuration.nix</code>:
To edit <code>/etc/hosts</code> just add something like this to your <code>configuration.nix</code>:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
networking.extraHosts = ''
networking.hosts = {
   127.0.0.2 other-localhost
   "127.0.0.2" = ["other-localhost"];
   10.0.0.1 server
   "192.0.2.1" = ["mail.example.com" "imap.example.com"];
'';
};
</syntaxhighlight>
</syntaxhighlight>