You are not logged in.

#1 2017-05-07 20:44

geekapalooza
Member
Registered: 2017-04-22
Posts: 4

Change Hostname?

My install of Q4OS automatically set the hostname to "q4os-desktop" but this doesn't conform to my device naming convention.

With my (very) limited skills, I changed the hostname using "sudo hostname XYZ" but this appears to only apply to my current session and is lost on reboot - at which time the system reverts back to the original hostname.

A bit of research seems to suggest that I need to edit a couple of configuration files:
/etc/hostname
/etc/hosts

But, before I attempted this, I thought best to check with our community of experts to see if this is a "complete" solution (in other words, do I need to make any changes elsewhere, too?) or to see if this could potentially have some unanticipated side effects.

Thank you!!

Offline

#2 2017-05-07 20:56

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Change Hostname?

I haven't had to do this recently but I thought you only needed to change /etc/hostname, although it would make sense to change /etc/hosts too, I can't see that this would cause any problems if it were wrong unless your router requires your specific hostname although most usually just read the mac address.
If you type man hostname it will go into more detail of what can be done and what changes are made etc, might not give you an answer to the question but might enlighten you a little more to how it works. smile

Offline

#3 2017-05-07 22:29

geekapalooza
Member
Registered: 2017-04-22
Posts: 4

Re: Change Hostname?

Hostname and hosts config files both edited and the changes are successful!  (A big accomplishment for a Linux noob!)

And a review of the man pages indicates that the hostname command is "effective only until the next reboot."  smile


The only thing more impressive than this OS is the amazing community that helps to support it!

Thank you to all who so quickly reviewed my post!

And a special THANK YOU to Dai_trying for the lightning fast response AND for the great advice about man pages!  Enlightenment indeed!  Thank you for taking the time to teach me to fish!

Last edited by geekapalooza (2017-05-07 22:30)

Offline

#4 2017-05-07 22:41

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Change Hostname?

You are welcome, I'm glad it helped. smile

Offline

#5 2017-05-07 22:57

crosscourt
Member
Registered: 2017-05-07
Posts: 1,805
Website

Re: Change Hostname?

Heres a good article that might shed some light as well,  www.tecmint.com/set-hostname-permanently-in-linux


Q4OS Aquarius 5.1 KDE   Lenovo Thinkcentre M900 Tiny i5-6500T, 16gb ddr4 ram, 512gb m.2 ssd

Offline

Board footer

Powered by FluxBB