Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-16-2005, 07:14 PM   #1
Registered: Jul 2004
Posts: 107

Rep: Reputation: 15
how do i change the name of my computer from "localhost"

im running FC3, and just wondering how i can change the name of my computer from localhost. you know, like at the prompt, how it says [user@localhost]$ (or something similar)
Old 04-16-2005, 07:38 PM   #2
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
the command you are looking for is hostname.

alone the command will show you the current name of the host (localhost)
but by placing something after it you will change the name.
hostname MyComputer

now use the command and you will get the new name (MyComputer)

to get more info on this check out the man on hostname

man hostname
Old 04-17-2005, 04:39 AM   #3
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
If you find that doesn't stay after a reboot, you can edit /etc/HOSTNAME and put it in that
Old 04-17-2005, 05:57 AM   #4
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Originally posted by Komakino
If you find that doesn't stay after a reboot, you can edit /etc/HOSTNAME and put it in that
depending on your distro's way of setting things up, FC3 might use /etc/conf.d/hostname or simply /etc/hostname (case sensitive).

Not as elegant, but works across distros, you could place the 'hostname whatever' command in your rc.local init script and have it set that way every boot.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost DHCP Lease when putting computer in "Standby" mode for a "long" time pnellesen Linux - Networking 1 01-06-2005 11:44 PM
How to change prompt hostname "localhost"? Arodef Fedora 3 08-02-2004 06:45 AM
computer name "localhost" deWin Linux - Networking 5 03-23-2004 12:11 PM
My computer is calling itself "localhost" in windows david_bridges Linux - Networking 2 12-21-2003 07:15 PM
How do I change name from "LocalHost"? jsin Linux - Newbie 3 10-29-2003 12:02 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration