You are not logged in.
So I have installed Arch Linux 2 days ago. I have configured hostname to be "localhost" in /etc/hostname file.
Yesterday I have noticed in my terminal that my hostname is set to "archlinux".
I did not set it to "archlinux". I have checked /etc/hostname file and it is still set to "localhost".
After that I have started looking at logs with journalctl and found that NetworkManager has set hostname to "archlinux".
Can someone explain how to force it to use hostname provided via /etc/hostname and why it was changed by itself in the first place.
Last edited by horseBehindFirewall (2017-11-20 12:31:22)
Offline
And what's in /etc/hosts?
Please post the content as text, not as a photo of text.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
"localhost" is the default and conflictive hostname and networkmanager alters it for that reason.
solution: don't use networkmanager, but "localhost" is no reasonable choice for a hostname anyway.
Notice that "localhost" will still resolve 127.0.0.1 even if you configure your hostname to "stable"
Offline
Moving to NC...
Offline
And what's in /etc/hosts?
Please post the content as text, not as a photo of text.
[nikola@archlinux ~]$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 localhost.localdomain localhost
127.0.0.2 localhost.localdomain localhost
Offline
Last try:
https://wiki.archlinux.org/index.php/Ne … e_hostname
A hostname is a unique name created to identify a machine on a network
Offline
How did you install Arch?
Offline
Last try:
https://wiki.archlinux.org/index.php/Ne … e_hostnameA hostname is a unique name created to identify a machine on a network
It is unique. It's only machine on my network with that name and I'm not even running DNS/mDNS or LLMNR.
Offline
As localhost is a reserved hostname with special meaning* using it as the hostname sounds like a bad idea calling for trouble. At least it is not surprising that it causes some issues. Networkmanager seems to fall back to its default in case it gets "localhost" as the host. Why not use a proper name then?
Offline
As localhost is a reserved hostname with special meaning* using it as the hostname sounds like a bad idea calling for trouble. At least it is not surprising that it causes some issues. Networkmanager seems to fall back to its default in case it gets "localhost" as the host. Why not use a proper name then?
Too lazy to be creative about hostnames. But yes I agree.
Btw how do I mark thread as solved? I was looking at forum for answer and just found to edit the name with "[Solved]" but I can't find edit buttons around thread name, only on comments.
Last edited by horseBehindFirewall (2017-11-20 12:17:29)
Offline
Edit your first post, you can alter the subject line there.
Offline