Operating System - HP-UX
1832878 Members
2652 Online
110048 Solutions
New Discussion

Re: I am unabe to get the hostname by excecuting uname -a ?

 
SOLVED
Go to solution
Sudhaadm
Regular Advisor

I am unabe to get the hostname by excecuting uname -a ?

Hi All,
Thanks in advance.

I am unable to get the hostnameafter excecuting uname -a command.
How can i get the information when it was changed and how can i restore without rebooting the server.?
uname -a
-t HP-UX B.10.20 U 9000/785 2015611644 unlimited-user license

> hostname
HP-UX
root@HP-UX:/
>
TX

6 REPLIES 6
Luk Vandenbussche
Honored Contributor

Re: I am unabe to get the hostname by excecuting uname -a ?

Hi,

You can perfectly change your hostname online
with the command

hostname newname

Check /etc/hosts afterwards to see if the relation between IP adress and hostname are correct
Indira Aramandla
Honored Contributor

Re: I am unabe to get the hostname by excecuting uname -a ?

Hi Sudhaadm,

uname command displays selected information about the about the current computer system, derived from the utsname structure.

To get the hostname type in hostname and it shoud return the host name. Or look in the file /etc/hosts on the DNS server.


IA
Never give up, Keep Trying
Sudhaadm
Regular Advisor

Re: I am unabe to get the hostname by excecuting uname -a ?

Hi there is a entry in /etc/hosts file.Eventhough ,i am uable to query the hostname.?

If i change the host name by using the command: hostname servername,will it add permanantly(After rebboting the Server)?
Andrew Rutter
Honored Contributor

Re: I am unabe to get the hostname by excecuting uname -a ?

hi,

id prefer to use
#set_parms hostname

this updates the conf files for you and saves you having to change the hosts file manually. This will want a reboot to tkae effect though.

it is still worth checking the hosts file though afterwards and nslookup aswell

Andy
Luk Vandenbussche
Honored Contributor

Re: I am unabe to get the hostname by excecuting uname -a ?

To make it permanent

set_parms hostname

Muthukumar_5
Honored Contributor
Solution

Re: I am unabe to get the hostname by excecuting uname -a ?

Do this:

# hostname HP-UX
# uname -S HP-UX
# edit /etc/rc.config.d/netconf file as,
HOSTNAME="HP-UX"

# Update /etc/hosts file with this changes. (may be good)

It will work now. Else revert ;)
Easy to suggest when don't know about the problem!