-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/networking: add fqdn to /etc/hosts #72077
Conversation
Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
cc @zimbatm |
What about cases where /etc/hostname itself is a fqdn?
|
Yeah that's why I wanted you to be involved. In my experience it's best not to use FQDN as the machine hostname but it's certainly a possibility. |
Referring to the man-page hostname(5), it should only includes the hostname. How does this sound for you? |
In that case it might be even better to disallow it entirely. Fail if the hostname is not valid. |
I just see there are some distros like Fedora, who add the fqdn to the |
Hm, I also had a fqdn in Reading a bit on the internet, this is probably a bad idea. Can we raise a warning if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the problem of a non-qualified domain name for a lot of e-mail tools (alpine, GNU Mailutils)
If |
feel free to cherry-pick my strict hostName change: fc7a9b82e30f819f4d08c33995002df1710bb28f |
I agree with @zimbatm, but this would need some release notes, and maybe a better error message too. |
Thx, I did cherry-pick this commit but I agree with @flokli. e.g.: networking.hostName = foo.bar.org; -> |
@sylv-io can you add the warning and release notes? |
Already started to work on it 👍 |
I assume you can just wrap |
@primeos don't worry. my bad that i didn't continued to work on it 👍 |
Motivation for this change
Referring to the manpage hosts(5), the fully qualified domain name (fqdn) is used to be included to the static lookup table for hostnames in case it is defined.
Some modules in different programming languages refer to it. (e.g. python socket.gethostname())
Things done
If networking.domain is defined, it will be added to
/etc/hosts
.sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @oxij