SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2015-07-11 02:16:10

userx-bw
#! Die Hard
From: stuck in an unknown reality
Registered: 2013-11-19
Posts: 735

<SOLVED>how to permanently change hostname even after reboot

I've changed every file that I have found to have my host name in it that I've googled my fingers off trying to get this hostname to change permanently even after reboot, it still goes back to the original hostname I gave it during install.

even when I type out $hostname it still shows the old name when all of the files I've change still show the new hostname.

Last edited by userx-bw (2015-07-11 23:01:30)


"How can you learn how to fix it, if you don't break it first? :8
"the only way to get away with murder is - by killing time" swp 1997  8o
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."

Offline

Be excellent to each other!

#2 2015-07-11 02:40:42

smacz
#! Junkie
Registered: 2014-12-09
Posts: 250

Re: <SOLVED>how to permanently change hostname even after reboot

If you're still running wheezy/waldorf, then editing '/etc/hostname' and then restarting the networking service with sudo service networking restart running the /etc/init.d/hostname.sh script should do the trick. Had you been running that script?

EDIT: Found an nixCraft article.

Last edited by smacz (2015-07-11 02:45:19)

Offline

#3 2015-07-11 12:47:05

userx-bw
#! Die Hard
From: stuck in an unknown reality
Registered: 2013-11-19
Posts: 735

Re: <SOLVED>how to permanently change hostname even after reboot

smacz wrote:

If you're still running wheezy/waldorf, then editing '/etc/hostname' and then restarting the networking service with sudo service networking restart running the /etc/init.d/hostname.sh script should do the trick. Had you been running that script?

EDIT: Found an nixCraft article.

slackware wink but even in the forum no one seems to know what to do.


"How can you learn how to fix it, if you don't break it first? :8
"the only way to get away with murder is - by killing time" swp 1997  8o
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."

Offline

#4 2015-07-11 13:22:45

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: <SOLVED>how to permanently change hostname even after reboot

Slackware & Debian

In Slackware and Debian you set the hostname during the install, it is stored in /etc/HOSTNAME ( Slackware ) and /etc/hostname ( Debian )


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5 2015-07-11 13:31:49

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: <SOLVED>how to permanently change hostname even after reboot

OR:

Use sysctl to change the hostname

sysctl kernel.hostname

to read the current hostname, and as root

sudo sysctl kernel.hostname=NEW_HOSTNAME

to change it.

I believe at least a log-out is necessary.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6 2015-07-11 15:23:13

userx-bw
#! Die Hard
From: stuck in an unknown reality
Registered: 2013-11-19
Posts: 735

Re: <SOLVED>how to permanently change hostname even after reboot

Sector11 wrote:

Slackware & Debian

In Slackware and Debian you set the hostname during the install, it is stored in /etc/HOSTNAME ( Slackware ) and /etc/hostname ( Debian )

I know, but when I go in and nano that file /etc/HOSTNAME then change it. reboot, it is still there but the original  name I gave Linux does not name change to that file, then in /etc/hosts again change to reflect new name to match /etc/HOSTNAME still nope and one more file I forget but it did have something to do with the name  kernel  somewhere in the path to it or file

still looking into it, I'll check what you posted in the your post after this. thanks


"How can you learn how to fix it, if you don't break it first? :8
"the only way to get away with murder is - by killing time" swp 1997  8o
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."

Offline

#7 2015-07-11 15:44:31

userx-bw
#! Die Hard
From: stuck in an unknown reality
Registered: 2013-11-19
Posts: 735

Re: <SOLVED>how to permanently change hostname even after reboot

Sector11 wrote:

OR:

Use sysctl to change the hostname

sysctl kernel.hostname

to read the current hostname, and as root

sudo sysctl kernel.hostname=NEW_HOSTNAME

to change it.

I believe at least a log-out is necessary.

NO NO NO NO!!!!!! wtf Linux?????

it seems to be a bigger secret then I thought, as every method I've tried is only a temporary change.

seems to be like a SSN number to the human in America. once you get one you can't change it.

Last edited by userx-bw (2015-07-11 15:45:59)


"How can you learn how to fix it, if you don't break it first? :8
"the only way to get away with murder is - by killing time" swp 1997  8o
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."

Offline

#8 2015-07-11 20:24:36

smacz
#! Junkie
Registered: 2014-12-09
Posts: 250

Re: <SOLVED>how to permanently change hostname even after reboot

Yeah, sorry. I've only really worked on Debian, CentOS 7, and a little bit of Arch. I'm working my way up to Slackware.

But it does seem like there'd be a way to change it. MAC addresses are closer to the equivalent of SSN's if we're doing that metaphor.

Offline

#9 2015-07-11 21:18:23

userx-bw
#! Die Hard
From: stuck in an unknown reality
Registered: 2013-11-19
Posts: 735

Re: <SOLVED>how to permanently change hostname even after reboot

^ MAC Addresses would work better for a metaphor thanks,

Slackware is really not that hard, really. Just the way one installs the programs they want. and Lilo boot loader, Had to take a chance on going expert, then got it to do what I wanted it to.

if you have Oracel VirtualBox install a copy of Slackware on it, if not then install virtualbox that too is really easy. for slackware on VB just go to slackbuilds then install inside of the client virtualbox-addons for ful screen

remember to read all of the readmes for further instructions.

Slackware is not that hard. for what I do with it anyways Arch uses their ideology
back on track of post

as far as changing hostnames permanently it seems to have the same difficulty across the board in linux world. Changing hostname / computer name really is easier in MS Windows


"How can you learn how to fix it, if you don't break it first? :8
"the only way to get away with murder is - by killing time" swp 1997  8o
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."

Offline

#10 2015-07-11 21:20:39

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: <SOLVED>how to permanently change hostname even after reboot

@S11 - no systemd in slackware

@userx-bw usually all you need to do is edit the /etc/HOSTNAME file. If that didn't work you can try as root:

netconfig

you can change host name and computer name that way.

What forum are you using?

Official forum for slackware is the slackware subsection at linuxquestions.org There should be an answer to what you're trying to do in there.

Last edited by PackRat (2015-07-11 21:22:06)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#11 2015-07-11 21:22:02

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: <SOLVED>how to permanently change hostname even after reboot

userx-bw wrote:

it seems to have the same difficulty across the board in linux world

# echo "new_name" > /etc/hostname

Works just fine in Arch & Debian...

EDIT: +1 for asking over at LQ -- the real Slackware experts hang out there, Patrick Volkerding even posts there sometimes.

Last edited by Head_on_a_Stick (2015-07-11 21:24:01)

Offline

#12 2015-07-11 21:26:57

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: <SOLVED>how to permanently change hostname even after reboot

Note to $SELF:

-  Always choose a host name you can live with when installing!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#13 2015-07-11 22:25:55

userx-bw
#! Die Hard
From: stuck in an unknown reality
Registered: 2013-11-19
Posts: 735

Re: <SOLVED>how to permanently change hostname even after reboot

Head_on_a_Stick wrote:
userx-bw wrote:

it seems to have the same difficulty across the board in linux world

# echo "new_name" > /etc/hostname

Works just fine in Arch & Debian...

EDIT: +1 for asking over at LQ -- the real Slackware experts hang out there, Patrick Volkerding even posts there sometimes.

that is just like nano /etc/HOSTNAME  (slackware) and upon reboot it goes back to the original  name given at setup

Edit- oh I've looked over there too before dropping in here to post this question

Last edited by userx-bw (2015-07-11 22:27:57)


"How can you learn how to fix it, if you don't break it first? :8
"the only way to get away with murder is - by killing time" swp 1997  8o
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."

Offline

#14 2015-07-11 22:38:59

userx-bw
#! Die Hard
From: stuck in an unknown reality
Registered: 2013-11-19
Posts: 735

Re: <SOLVED>how to permanently change hostname even after reboot

PackRat wrote:

@S11 - no systemd in slackware

@userx-bw usually all you need to do is edit the /etc/HOSTNAME file. If that didn't work you can try as root:

netconfig

you can change host name and computer name that way.

What forum are you using?

Official forum for slackware is the slackware subsection at linuxquestions.org There should be an answer to what you're trying to do in there.

been their before here in google lead me their too I had this same prob in Debian -- I got it half fixed in Debian I think if I remember rightly --- it is not just a one file fix -- if I remember correctly on that too

EDIT --
came back and looked at what you said as it was all becoming a blur to me then tried it,
/etc/HOSTNAME edit as root didn't work
but that command did as soon as I seen what it did, popped up that window I knew it'd work

thank you!
it worked

Last edited by userx-bw (2015-07-11 23:00:50)


"How can you learn how to fix it, if you don't break it first? :8
"the only way to get away with murder is - by killing time" swp 1997  8o
"A computer is only as smart as the person using it"
"Just plug it in and see if it blows up, if not then take it apart and figure out how it works."

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo