Discussion:
Fedora 8 hostname
(too old to reply)
John Moesner
2009-06-24 02:36:01 UTC
Permalink
I have Fedora 8 loaded and am trying to us it primarily as a server.
Web server, FTP server, telnet server, tftp server, SMB server, etc.
I messed up when I set the hostname to localhost. I found that
localhost does not work well for SMB services. I can change the name to
something else such as server. That will work well until a power
failure then the hostname reverts back to local host How can I make the
hostname change permanent without reloading the system?
Thanks,
John Moesner
Jan Gerrit Kootstra
2009-06-24 03:17:08 UTC
Permalink
Post by John Moesner
I have Fedora 8 loaded and am trying to us it primarily as a server.
Web server, FTP server, telnet server, tftp server, SMB server, etc.
I messed up when I set the hostname to localhost. I found that
localhost does not work well for SMB services. I can change the name to
something else such as server. That will work well until a power
failure then the hostname reverts back to local host How can I make the
hostname change permanent without reloading the system?
Thanks,
John Moesner
John,


vi /etc/sysconfig/network

or

system-config-network
choose the dns tab


Kind regards,


Jan Gerrit Kootstra
John Thompson
2009-06-25 02:38:16 UTC
Permalink
Post by John Moesner
I have Fedora 8 loaded and am trying to us it primarily as a server.
Web server, FTP server, telnet server, tftp server, SMB server, etc.
I messed up when I set the hostname to localhost. I found that
localhost does not work well for SMB services. I can change the name to
something else such as server. That will work well until a power
failure then the hostname reverts back to local host How can I make the
hostname change permanent without reloading the system?
"man hostname"
--
-John (***@os2.dhs.org)
Moe Trin
2009-06-25 19:35:48 UTC
Permalink
On Wed, 24 Jun 2009, in the Usenet newsgroup comp.os.linux.redhat, in article
Post by John Thompson
I can change the name to something else such as server. That will
work well until a power failure then the hostname reverts back to
local host How can I make the hostname change permanent without
-------------------------------------------------^^^^^^^^^
Post by John Thompson
reloading the system?
"man hostname"
[compton ~]$ whatis hostname
hostname (1) - show or set the system's host name
[compton ~]$

That only changes the hostname "now" - not permanently. I'm sure
there is some wonderful ``helper'' tool for the clueless, but if you
look at the boot scripts, the hostname is set using the HOSTNAME
variable in /etc/sysconfig/network

Old guy
John Thompson
2009-06-26 00:32:58 UTC
Permalink
Post by Moe Trin
On Wed, 24 Jun 2009, in the Usenet newsgroup comp.os.linux.redhat, in article
Post by John Thompson
"man hostname"
[compton ~]$ whatis hostname
hostname (1) - show or set the system's host name
[compton ~]$
That only changes the hostname "now" - not permanently. I'm sure
there is some wonderful ``helper'' tool for the clueless, but if you
look at the boot scripts, the hostname is set using the HOSTNAME
variable in /etc/sysconfig/network
From "man hostname:"

OPTIONS

-F, --file filename
Read the host name from the specified file. Com-
ments (lines starting with a `#') are ignored.
--
-John (***@os2.dhs.org)
Jan Gerrit Kootstra
2009-06-26 05:32:24 UTC
Permalink
Post by John Thompson
Post by Moe Trin
On Wed, 24 Jun 2009, in the Usenet newsgroup comp.os.linux.redhat, in article
Post by John Thompson
"man hostname"
[compton ~]$ whatis hostname
hostname (1) - show or set the system's host name
[compton ~]$
That only changes the hostname "now" - not permanently. I'm sure
there is some wonderful ``helper'' tool for the clueless, but if you
look at the boot scripts, the hostname is set using the HOSTNAME
variable in /etc/sysconfig/network
From "man hostname:"
OPTIONS
-F, --file filename
Read the host name from the specified file. Com-
ments (lines starting with a `#') are ignored.
John,


read

Where as John Moestner needs a place to write.


Kind regards,


Jan Gerrit
Moe Trin
2009-06-26 19:58:16 UTC
Permalink
On Thu, 25 Jun 2009, in the Usenet newsgroup comp.os.linux.redhat, in article
Post by John Thompson
Post by Moe Trin
That only changes the hostname "now" - not permanently. I'm sure
there is some wonderful ``helper'' tool for the clueless, but if
you look at the boot scripts, the hostname is set using the
HOSTNAME variable in /etc/sysconfig/network
From "man hostname:"
OPTIONS
-F, --file filename
Read the host name from the specified file. Com-
ments (lines starting with a `#') are ignored.
Did you try that? You really ought to, as I don't think you want
the hostname to be whatever the last line in that file is. And in
any case, the hostname is not _PERMANENTLY_ changed.

Repeating - look at the boot scripts

Old guy
John Thompson
2009-06-26 23:50:08 UTC
Permalink
Post by Moe Trin
On Thu, 25 Jun 2009, in the Usenet newsgroup comp.os.linux.redhat, in article
Post by John Thompson
OPTIONS
-F, --file filename
Read the host name from the specified file. Com-
ments (lines starting with a `#') are ignored.
Did you try that? You really ought to, as I don't think you want
the hostname to be whatever the last line in that file is. And in
any case, the hostname is not _PERMANENTLY_ changed.
So you create a file, e.g. /etc/hostname for example, that consists of
the hostname and nothing more. Then you put a line in e.g. rc.local for
example "hostname -F /etc/hostname"

Where's the problem?
Post by Moe Trin
Repeating - look at the boot scripts
Isn't that what I just did?
--
-John (***@os2.dhs.org)
Moe Trin
2009-06-27 02:33:12 UTC
Permalink
On Fri, 26 Jun 2009, in the Usenet newsgroup comp.os.linux.redhat, in article
Post by John Thompson
Post by Moe Trin
Did you try that? You really ought to, as I don't think you want
the hostname to be whatever the last line in that file is. And in
any case, the hostname is not _PERMANENTLY_ changed.
So you create a file, e.g. /etc/hostname for example, that consists
of the hostname and nothing more. Then you put a line in e.g.
rc.local for example "hostname -F /etc/hostname"
Where's the problem?
This isn't Debian or Gentoo (or clones) - so the boot scripts are not
looking at /etc/hostname. But as you recall, /etc/rc.local is the
"last" boot script run, so all of your services that are started
before that script are using the wrong hostname. Some daemons
really aren't happy running as 'localhost' which is the O/P's problem.
Post by John Thompson
Post by Moe Trin
Repeating - look at the boot scripts
Isn't that what I just did?
Apparently not. On a classic SysVinit setup (rather than the
'upstart' crap), you'd find the hostname set in rc.sysinit
which is the first script run:

# Read in config data.
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
else
NETWORKING=no
HOSTNAME=localhost
fi

# Set the hostname.
hostname ${HOSTNAME}
echo hostname: `hostname`

'upstart' does the same thing, as one of the first boot tasks.
If you are using the whizzy ``helper'' tools like the
system-config-boot package, it is going to change the hostname by
changing the HOSTNAME variable in /etc/sysconfig/network.
Why reinvent the wheel?

Old guy
Jon Mack
2011-11-29 18:13:55 UTC
Permalink
Take a look at /etc/sysconfig/network. There should be a entry for HOSTNAME.
You can modify it as root or with sudo.

If that's not the correct location to make it persistent, do a "man
hostname". Should show you the location of the file that would need to be
modified to make it persistent.

Jon

"John Moesner" wrote in message news:nig0m.399$***@newsfe09.iad...

I have Fedora 8 loaded and am trying to us it primarily as a server.
Web server, FTP server, telnet server, tftp server, SMB server, etc.
I messed up when I set the hostname to localhost. I found that
localhost does not work well for SMB services. I can change the name to
something else such as server. That will work well until a power
failure then the hostname reverts back to local host How can I make the
hostname change permanent without reloading the system?
Thanks,
John Moesner
Moe Trin
2011-11-30 19:42:33 UTC
Permalink
On Tue, 29 Nov 2011, in the Usenet newsgroup comp.os.linux.redhat, in article
Post by Jon Mack
Take a look at /etc/sysconfig/network.
Take a look at the date of the post you're responding to.
Date: Tue, 23 Jun 2009 21:36:01 -0500

I really doubt the O/P is still reading. You should also be aware
that Fedora 8 was obsolete by that date (Fedora 11 was released on
9 June 2009).
Post by Jon Mack
If that's not the correct location to make it persistent, do a "man
hostname". Should show you the location of the file that would need
to be modified to make it persistent.
[compton ~]$ whatis hostname
hostname (1) - show or set the system's host name
hostname (7) - host name resolution description
[compton ~]$

You didn't look at the man pages, did you? Setting hostname is a
distribution specific function. Some read the value from /etc/hostname,
some use /etc/sysconfig/network, some use /etc/HOSTNAME, some use
/etc/rc.conf. The way to figure out which is which is to look at the
boot scripts - and even that varies by distribution. Most distros
also have some GUI tool that can set the hostname as well.

Old guy

Loading...