3
0
Fork 0
forked from mirrors/nixpkgs

nixos/networking: add hostname to /etc/hosts by default

We use `127.0.1.1` instead of `127.0.0.1` because some applications will fail if
`127.0.0.1` resolves to something other than `localhost`.

Debian does the same.

See #1248 and #36261.
This commit is contained in:
Jan Malakhovski 2018-09-23 15:55:39 +00:00
parent 1ece5041a4
commit c57892462b

View file

@ -215,6 +215,8 @@ in
networking.hosts = {
"127.0.0.1" = [ "localhost" ];
} // optionalAttrs (cfg.hostName != "") {
"127.0.1.1" = [ cfg.hostName ];
} // optionalAttrs cfg.enableIPv6 {
"::1" = [ "localhost" ];
};