LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-26-2004, 03:17 PM   #1
lel800
Member
 
Registered: Aug 2003
Distribution: Red Hat RHEL WS 3, RHEL WS 4
Posts: 228

Rep: Reputation: 30
Determine Computer name


I've forgotten the name of my computer and my need to rename it.
There's a chance I named it incorrectly.

Is there a command I can use in the terminal to determine the name of my laptop
for networking purposes?
 
Old 01-26-2004, 03:30 PM   #2
nmayotte
Member
 
Registered: Jan 2004
Location: Minnesota
Distribution: SuSE 8.0-9.0
Posts: 37

Rep: Reputation: 15
try "more /etc/hostname" theres usually a file in /etc/ that is just for the hostname
 
Old 01-26-2004, 04:29 PM   #3
lel800
Member
 
Registered: Aug 2003
Distribution: Red Hat RHEL WS 3, RHEL WS 4
Posts: 228

Original Poster
Rep: Reputation: 30
Thanks for your reply...
I don't see a file called "hostname" inside /etc. I only see the file "hosts" and this contains
only --> 127.0.0.1 localhost.localdomain local host

Not quite what I'm looking for. But thanks though.
 
Old 01-26-2004, 04:37 PM   #4
Parksy
Member
 
Registered: Apr 2003
Distribution: Gentoo/Mandrake 10.0
Posts: 110

Rep: Reputation: 15
How did you name it initially? You can edit the /etc/hosts files on the other computers so that they have a name for your computer's IP address. However, you'll have to change those /etc/host files any time your IP address changes.
 
Old 01-26-2004, 04:49 PM   #5
lel800
Member
 
Registered: Aug 2003
Distribution: Red Hat RHEL WS 3, RHEL WS 4
Posts: 228

Original Poster
Rep: Reputation: 30
Hi thanks for your response

To be honest, I don't remember ever naming it. I assumed that I did when I installed the OS (referring to a laptop with Mandrake installed). If I wished to give the computer a name how would I do that?
 
Old 01-26-2004, 05:02 PM   #6
Parksy
Member
 
Registered: Apr 2003
Distribution: Gentoo/Mandrake 10.0
Posts: 110

Rep: Reputation: 15
It all depends on why you want it named.

If you want your command prompt to show up as user1@mycomputername instead of user1@localhost, you can edit your own /etc/hosts file. Mine looks like this:

Code:
127.0.0.1     localhost
192.168.1.100     darcy
That way my command prompt shows up as user1@darcy (because darcy is the last entry). This way I can still access my http server via http://localhost (as well as http://darcy).

You can edit the /etc/hosts file to relate an IP address of another computer on the network. This was you can, for example, type "ping ted" instead of "ping 192.168.1.123" or whatever. These modifications have to be made on each computer for which you want them to take effect.

If you're using SAMBA, you can edit the config file with a name for your computer so that other computers will see it as having that name.

If you don't have any reason to name your computer, don't worry about it. If you have another reason, just ask. These are the only ones I can think of.
 
  


Reply



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
installing linux on a computer and use hard disk on another computer danrweki Linux - Newbie 8 11-16-2005 10:11 PM
Can't copy files from an SCO Unix System V computer to a Linux computer gnppapas Linux - General 2 11-27-2004 01:39 PM
how do you determine the static ip your computer should use jooper317 Linux - Hardware 1 01-06-2004 07:16 PM
Why would a windows computer smoke a linux computer for download speed ? lostboy Linux - General 4 10-21-2003 05:20 PM
How can i portage Linux from computer with Celeron proc to computer with Pentium 166? gdi Linux - General 4 05-31-2003 01:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:20 AM.

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
Open Source Consulting | Domain Registration