Force hosts to contain proper localhost

This commit is contained in:
root 2021-04-12 13:38:56 -07:00
parent 5f75be732c
commit 7f3c409d56
2 changed files with 17 additions and 2 deletions

View File

@ -31,7 +31,7 @@ in {
};
libdefaults = {
allow_weak_crypto = false;
allow_weak_crypto = true;
dns_lookup_kdc = true;
dns_lookup_realm = true;
forwardable = true;

View File

@ -143,7 +143,22 @@ in {
# Necessary to ensure that Kerberos and Avahi both work. Kerberos needs
# the fqdn of the host, whereas Avahi wants just the simple hostname.`
hosts = { "127.0.0.1" = [ "${hostname}.${domain-name}" "${hostname}" ]; };
hosts = {
"127.0.0.2" = [ "${hostname}.${domain-name}" "${hostname}" ];
"127.0.0.1" = [ "${hostname}.${domain-name}" "${hostname}" ];
"::1" = [ "${hostname}.${domain-name}" "${hostname}" ];
};
};
environment.etc.hosts = mkForce {
text = ''
127.0.0.1 ${hostname}.${domain-name} ${hostname} localhost
127.0.0.2 ${hostname} localhost
::1 ${hostname}.${domain-name} ${hostname} localhost
'';
user = "root";
group = "root";
mode = "0444";
};
nix = mkIf