Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set Computer Name & Hostname ? 1

Status
Not open for further replies.

power97

Programmer
Sep 17, 2003
67
CA
Hi,
I was wondering if someone could tell me how to set the hostname and the computer name for my Linux box ? ( Mandrake 9.1 )

Thanks

 
/etc/hostname

and the 'hostname' command

the command sets it until reboot
the change in the file sets it every reboot (and maybe every restart of network services)

"Surfinbox Shares" - A fundraising program that builds revenue from dialup Internet users.
 
In Linux, there is only a hostname. Computer name doesn't mean anything (to me).

you may call your computer using a hostname such as "host1" or you may refer to it by setting the hostname with a domain you own "host1.example.com". In either case, the hostname is host1.

A host, in Unix parlance, is the name for a specific machine. This all those 'net entries for " are requests to talk to the host " at the domain.

Clear? Helpful?

"Surfinbox Shares" - A fundraising program that builds revenue from dialup Internet users.
 
Running the hostname command will not "keep" the settings past a reboot.

Look for this file /etc/sysconfig/network

Edit the file and look for section hostname.

Change your hostname to what ever you want it to be. Next, edit /etc/hosts and also put your hostname and ip address there.

In /etc/hosts, you need both long name and short name.

Long Name: Fully Qualified Domain Name
myserver.mydomain.com

Short Name: Just the name of the server
myserver

Now reboot and you should be set.


>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
Any ideas on how to do this in SuSE? There isn't a file called "/etc/sysconfig/network, or even a sysconfig directory.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top