Exforsys

Online Training

Is this possible

This is a discussion on Is this possible within the Linux forums, part of the Operating Systems category; Is it possible to change the hostname of a Linux machine? If so what are the steps for doing this. ...


Go Back   Exforsys > Operating Systems > Linux

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2007, 11:06 AM
Senior Member
 
Join Date: Apr 2006
Posts: 122
rachelle is on a distinguished road
Is this possible

Is it possible to change the hostname of a Linux machine? If so what are the steps for doing this. If anyone provides me the idea I will also try this out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-29-2007, 12:48 PM
Senior Member
 
Join Date: Apr 2006
Posts: 153
cyrus is on a distinguished road
You can change the hostname on any Linux system with the command ‘hostname‘.

The syntax is as below:
#hostname

Without any parameter it will output the current hostname of the system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-29-2007, 01:18 PM
Senior Member
 
Join Date: Apr 2006
Posts: 162
sammy is on a distinguished road
You can also use hostname on any Linux system with the command ‘hostname‘with parameters as below:
#hostname –fqd

The above would output the fully qualified domain name (or FQDN) of the system.

#hostname NEW_NAME

The above parameter option would set the hostname of the system to NEW_NAME.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-29-2007, 01:37 PM
Senior Member
 
Join Date: Apr 2006
Posts: 125
ashlee is on a distinguished road
If you use a Debian based Linux systems you can achieve Permanent hostname change as follows:

Debian based systems use the file /etc/hostname to read the hostname of the system at boot time and set it up using the init script /etc/init.d/hostname.sh

#cat /etc/hostname

debianadmin

So on a Debian based system we can edit the file /etc/hostname and change the name of the system and then run

/etc/init.d/hostname.sh startto make the change active. The hostname saved in this file (/etc/hostname) will be preserved on system reboot
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:03 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.