diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix index a1ee6a4304ac..1eb6fb43604a 100644 --- a/nixos/modules/config/networking.nix +++ b/nixos/modules/config/networking.nix @@ -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" ]; };