Review your favorite Linux distribution.
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 08-12-2003, 05:41 PM   #1
LQ Newbie
Registered: Aug 2003
Location: Los Angeles, CA
Posts: 14

Rep: Reputation: 0
Question renaming a linux host

How do I rename a host/computer in linux? I want to rename the computer entirely. It looks like it just named itself whatever the last computer was at the IP address it is on, I want to name it something that has more meaning to me. Also, what editor should I use to modify text files? I am using Mandrake 9.1 if that is important.
Old 08-12-2003, 11:34 PM   #2
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188

Rep: Reputation: 30
you can usually do this by editing /etc/hosts.

but since you say the name is related to some IP, you might want to talk to your DNS admin.

as for editing texts, you have a pretty wide choice:

vi/vim, emacs, gedit, kwrite, kate, pico, nano, jed, joe, .... just to name a few.
Old 08-05-2005, 03:45 AM   #3
LQ Newbie
Registered: Nov 2004
Distribution: SUSE 10.1
Posts: 25

Rep: Reputation: 15
Thats not what he means

he is not refering to hosts as in hostnames resolved by DNS. But actual computer name. The stuff you need when you configure a server.

by default it's [yourusername@localhost current directory]

I am guessing that his distro displays his actual IP addres instead of localhost. curent directory is what directory your in. you should start in your home folder which is usualy represented as ~.

Thus if your username is Jake
and your computer name is not set it would pull up localhost by default
so prompt would look like this:

[jake@localhost ~] the ~ indicates that you in the home directory of the user jake

What he wants to do is rename localhost to something like linuxbox or windowscrusher or somthing

DNS only resolves host ip when you connect to another computer via hostname. so it does not have anytthing to do with asigning hostnames. DHCP asigns IP adresses. I could be that everytime he logsin he sees a difrent address becuse in his distro instead of showing localhost it displays his curent IP address which DHCP of his ISP is giving him.

how to change localhost to whatever you want? That's what I would like to know, I got two linux books, they totaly leave that part out.
Old 08-05-2005, 05:42 AM   #4
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 845

Rep: Reputation: 33
Just edit your /etc/HOSTNAME file to the name you want to change to.
Old 08-07-2005, 06:50 AM   #5
Registered: May 2005
Posts: 378

Rep: Reputation: 33
how to change localhost to whatever you want? That's what I would like to know, I got two linux books, they totaly leave that part out.
localhost is a special name that some programs rely on, so you'd be wise not to change it. However, you can alias it by doing something like
Code:   localhost nameyouwant
in your /etc/hosts file. If you put nameyouwant first, that's the name that eg. ping will return.


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
Linux Host Or Windows Host ?? my-unix-dream Linux - General 2 05-18-2005 12:40 PM
Will a firewire host adaptor with a Linux supported IEEE1394 chipset work in linux? mmx87 Linux - Hardware 1 09-25-2004 02:22 AM
Renaming Windows Files from Linux Lonely_warrior Linux - General 3 07-13-2004 09:58 PM
Renaming my Linux domain Ishkabibble Linux - Networking 7 08-13-2003 09:32 PM
Renaming win xp (ntfs) file from Linux Goonie Linux - General 1 06-19-2003 04:00 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration