Changed hostname to -a


 
Thread Tools Search this Thread
Operating Systems Solaris Changed hostname to -a
# 1  
Old 02-16-2011
Changed hostname to -a

I was trying to execute the following command

ifConfig -a

and after a while my hostname changed to -a

I checked /etc/hosts and /etc/nodename all seems to be correct.

1. How my hostname changed to -a ? (What i could have done wrong)
2. if you type hostname where does solaris read the name from ?

---------- Post updated at 09:19 PM ---------- Previous update was at 09:18 PM ----------

I could not able to figure out how i changed my hostname ? and how can i roll it back ?
# 2  
Old 02-17-2011
hostname uses a system call (sysinfo or uname) which returns the system name that is stored on kernel memory.

You can simply revert back to the expected name with (ksh/bash syntax):
Code:
hostname $(</etc/nodename)

This User Gave Thanks to jlliagre For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Hostname -f hostname: Unknown host

deleted (0 Replies)
Discussion started by: hce
0 Replies

2. Shell Programming and Scripting

Script to echo "File permissions or ownership changed from required " when accidentally changed.

Hi All, I have to work in the late nights some times for server maintenance and in a hurry to complete I am accidentally changing ownership or permission of directories :( which have similar names ( /var in root and var of some other directory ).:confused: Can some one suggest me with the... (1 Reply)
Discussion started by: shiek.kaleem
1 Replies

3. Post Here to Contact Site Administrators and Moderators

Permissions Changed?

I cannot seem to post within any thread as I require moderator approval. I believe my permissions have been changed and was wondering whats the reason behind this. Thanks. (3 Replies)
Discussion started by: Banned
3 Replies

4. Emergency UNIX and Linux Support

HP UX - ILO Console hostname different than Machine Hostname...

Hi All, So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says: It should say: What gives? And how do... (4 Replies)
Discussion started by: zixzix01
4 Replies

5. UNIX for Dummies Questions & Answers

Password last changed

Hi, I am doing an audit and thought I knew what I was doing, but reading through the posts I came into doubt. On Sun Solaris, I want to know when users last changed their passwords. I have the etc/shadow files and there is a nice field showing this. Except that it is disturbing me somewhat that... (5 Replies)
Discussion started by: Norgaard
5 Replies

6. Shell Programming and Scripting

Timezone not changed.

Hi All, While installing Red Hat Linux, I tried changing the timezone to Japan for testing.But the timezone was not set to Japan. I tried other timezones , but they didn't work as well. I am guessing the problem might be due to some missing rpm.Does anyone has any idea or faced a similar... (1 Reply)
Discussion started by: nua7
1 Replies

7. UNIX for Dummies Questions & Answers

Who changed a file?

How can I tell what user last updated a file? (1 Reply)
Discussion started by: kirkm76
1 Replies

8. UNIX for Dummies Questions & Answers

Solaris - unknown hostname - how can I change hostname?

Hello, I am new to Solaris. I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
Discussion started by: XNOR
1 Replies

9. UNIX for Dummies Questions & Answers

Changed the hostname/IP and broke it (AIX)

A buddy of mine bought an older RS/6000 CAD workstation runing AIX to learn on, and had me put it on his LAN at home. I used smit to change the hostname/IP. After a reboot I try to login, and get a message saying that DTMessage cannot start, and gives a changed hostname as one of the possible... (3 Replies)
Discussion started by: 98_1LE
3 Replies
Login or Register to Ask a Question