1834015 Members
2757 Online
110063 Solutions
New Discussion

Re: Wrong hostname

 
PatRoy
Regular Advisor

Wrong hostname

Hi all.

I'm having a really strange problem with an HPUX 11.23 server.

For some reasons, when I type in `hostname`, it gives me the wrong hostname! It just gives me "-i". However, my /etc/rc.config.d/netconf has the proper hostname in. `uname -n` does give me the right hostname.

Has anyone seen this before?

Pat.
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: Wrong hostname

Perhaps someone entered "hostname -i" in an attempt to query the hostname?

I would run "/sbin/set_parms hostname" to reset it.


Pete

Pete
Basheer_2
Trusted Contributor

Re: Wrong hostname

Hi Pat,
on my 11.11

$ ls -ls /usr/bin/hostname
32 -r-xr-xr-x 1 bin bin 12288 Nov 14 2000 /usr/bin/hostname

$ file /usr/bin/hostname
/usr/bin/hostname: PA-RISC1.1 shared executable dynamically linked
Luk Vandenbussche
Honored Contributor

Re: Wrong hostname

Check also the setting in /etc/hosts
Bill Hassell
Honored Contributor

Re: Wrong hostname

To amplify Pete's answer, the 'someone' was root, that is, someone that knows the root password or has root privileges. The hostname command has no options so whatever is supploed after the command (by root) becomes the new hostname. You should be OK by issuing hostname with the correct name (as root).


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Wrong hostname

To amplify Pete's answer, the 'someone' was root, that is, someone that knows the root password or has root privileges. The hostname command has no options so whatever is supploed after the command (by root) becomes the new hostname. You should be OK by issuing hostname with the correct name (as root). Check root's .sh_history file to see where the hostname -i command was issued.


Bill Hassell, sysadmin
PatRoy
Regular Advisor

Re: Wrong hostname

Indeed, someone had issued a 'hostname -i'

Thanks guys!
Pat