- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Modify hostname
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 01:38 PM
02-22-2006 01:38 PM
For example: Assume hostname=HOSTA
In telnet Session1: Modify hostname to HOSTB
In telnet Session2: the hostanme still HOSTA
Thanks a lot.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 01:54 PM
02-22-2006 01:54 PM
SolutionHi,
NO, It is not possible.
May be you can set the hostname temporarily by #hostname HOSTB which will be appilcable till next reboot or next time you change the hostname using #hostname command. But whenever you change the hostname it WILL be applicable for ALL users/sessions connected to the server.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 02:53 PM
02-22-2006 02:53 PM
Re: Modify hostname
assuming the application or the script that you are going to work with it queries the hostname environment variable, you can just do:
export HOSTNAME=HOSTB
unfortunately, the hostname HOSTB command will not work! it does the change across the system
good luck
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 02:56 PM
02-22-2006 02:56 PM
Re: Modify hostname
It is not possible. Once you modify the hostname it affects the entire system. Who ever logs in, will see HOSTB, not HOSTA.
Hope this is clear.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 02:58 PM
02-22-2006 02:58 PM
Re: Modify hostname
It is impossible to my knowledge.
But, possible to change the hostname in all sessions temperiorly, by executing
$hostname
HTH,
Prabu.S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 03:17 PM
02-22-2006 03:17 PM
Re: Modify hostname
Use like,
# hostname
# uname -S
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 03:20 PM
02-22-2006 03:20 PM
Re: Modify hostname
If you want to have original hostname then /sbin/init.d/hostname stop;/sbin/init.d/hostname start will give that.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 03:25 PM
02-22-2006 03:25 PM
Re: Modify hostname
Please do not change the hostname using "hostname" or "uname",Though temperory this could cause trouble to the apps which are already refering the system with the old hostname.
Ex: CDE sessions for instance.
First let us know what is the purpose you are trying to achieve in wanting to do so.
Probably, someone here could provide a workaround solution based on your requirement.
Regards,
Senthil Kumar .A
P.S: Furthermore,I would stongly discourage doing so in production systems.More over only root can set the hostname temperorily using "hostname" command, so u can realize the gravity of doing the same right....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 03:27 PM
02-22-2006 03:27 PM
Re: Modify hostname
just one clarification. (did test it)
hostname HOSTB
command will change the hostname of the server at system level. Such that all sessions will be affected. Even those already connected. The hostname value will change for all sessions!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 04:32 PM
02-22-2006 04:32 PM
Re: Modify hostname
You can find more information by looking at the man page, # man hostname
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2006 02:04 AM
02-23-2006 02:04 AM
Re: Modify hostname
I would go with Senthil Kumar,
Pls be clear with your objective before going ahead and changing hostname while system is up and running. Your applicattions would go for a toss.
thanks
deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2006 02:04 AM
02-23-2006 02:04 AM
Re: Modify hostname
I would go with Senthil Kumar,
Pls be clear with your objective before going ahead and changing hostname while system is up and running. Your applicattions would go for a toss.
thanks
deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2006 12:38 PM
02-23-2006 12:38 PM
Re: Modify hostname
I suppose, that someone _really_ careful could replace the hostname command with a script and move the real hostname command somewhere that a shell user might not normally find it. Of course, that itsn't terribly robust, and there would still be the issue of the uname command, and then applications launched from that telnet session that called gethostname() and such...