LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-12-2003, 06:41 PM   #1
jgallas
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-13-2003, 12:34 AM   #2
jalal
Member
 
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, 04:45 AM   #3
Takezo
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, 06:42 AM   #4
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

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

Rep: Reputation: 33
Quote:
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:
127.0.0.1   localhost nameyouwant
in your /etc/hosts file. If you put nameyouwant first, that's the name that eg. ping 127.0.0.1 will return.
 
  


Reply


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


All times are GMT -5. The time now is 12:36 PM.

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