1829148 Members
2277 Online
109986 Solutions
New Discussion

hostname error

 
May_3
Advisor

hostname error

Hi,
The hostname I configured in /etc/hosts and /etc/rc.config.d/netconf is hpd380, but when (in command line) I run the command 'hostname' the retured value is d380 and I can not login to CDE, any ideas about this problem?
May
17 REPLIES 17
Sridhar Bhaskarla
Honored Contributor

Re: hostname error

You can set it back to hpd380 by executing the command

#hostname hpd380


This should fix your CDE problem.

Now to check if your netconf is working properly or not, try

#/sbin/init.d/hostname start
#hostname

if this returns again d380, then you need to re-verify your entry in /etc/rc.config.d/netconf.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Dayanand Naik
Frequent Advisor

Re: hostname error

Hi May,

1) you can edit the /etc/rc.config/netconf file and change the hostname value and the stop inetd services by /sbin/init.d/inetd stop and start from the shell command

2) else you can execute /sbin/set_parms hostname command which will allow you to modify the system name.

Hope that helps..

Regards,
Dayanand Naik.
Dayanand Naik
May_3
Advisor

Re: hostname error

Hi,Sridhar
I have verified that the entry in the /etc/rc.config.d/netconf is hpd380 and when I tried
#hostname hpd380
#/sbin/init.d/hostname start
#hostname
it retured d380 again, any further advise?
thank you for your reply.
May
May_3
Advisor

Re: hostname error

Hi,Dayanand
1)I tried
#/sbin/init.d/inetd stop
#/sbin/init.d/inetd start
#hostname
the retured value is d380
2)When I tried set_parms hostname, the hostname indicated that the hostname has already been set to hpd380
what should I do next?
May
Animesh Chakraborty
Honored Contributor

Re: hostname error

Hi May,
What is the output of uname -a ?
try uname -S hpd380



best of luck
Animesh
Did you take a backup?
Sridhar Bhaskarla
Honored Contributor

Re: hostname error

May,

Please do the following and see what you get

#hostname hpd380
#hostname
You should get hpd380 here.

Make sure that the entry in /etc/rc.config.d/netconf is correct and there are no duplicate entrees for HOSTNAME in that file.

HOSTNAME="hpd380"

/sbin/init.d basically does the same thing that we do at the command prompt. I can't think of any reason why it wouldn't set to hpd380 if it is properly specified in your netconf file.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
May_3
Advisor

Re: hostname error

Hi,animesh
The output of "uname -a" is as follows:
HP-UX hpd380 B.11.00 A 9000/810 2001361887 two-user license
When I tried
#hostname
it retured d380 again


May
Sridhar Bhaskarla
Honored Contributor

Re: hostname error

May,

It's very interesting. Let's double check if the hostname command works properly.

#hostname hpd380
#hostname

what's the output you are getting?.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Animesh Chakraborty
Honored Contributor

Re: hostname error

Hi may,
can you ping hpd380 from other server
using hpd380 hostname ?
ping hpd380.
try rebooting the server once.
"man hostname" may help you


best of luck
animesh
Did you take a backup?
May_3
Advisor

Re: hostname error

Hi,Sridhar
The command 'hostname' does work!
When I tried
#hostname hpd380
#hostname
the output is hpd380.
I am tired about it and I want to re-install the system. Thank you for you help anyway.

May
Best Regards,
May
Wodisch
Honored Contributor

Re: hostname error

Hello May,

I can just guess that you have an additional file in
"/etc/rc.config.d/" containing the definition of the
shell variable for the hostname - check with command:
grep HOSTNAME /etc/rc.config.d/*
wether there are multiple definitions of HOSTNAME=...
and then get rid of the duplicates (the one with
HOSTNAME=d380).
HTH,
Wodisch
Sridhar Bhaskarla
Honored Contributor

Re: hostname error

May,

No.. Don't get impatient. This is a very simple problem and you don't have to reinstall the system.

As I mentioned earlier, check your netconf file carefully for duplicate entries. /sbin/init.d/hostname script sets both hostname and uname using the entry in netconf. It uses the same command "hostname" to set the hostname. So,as I mentioned earlier, I strongly believe that there is a duplicate entry in your netconf file. Be little bit patient and verify each line like 'grep d380 /etc/rc.config.d/netconf'. I also would like you to check your /sbin/init.d/hostname script and search for the string d380. Someone might have hardcoded in there which is not supposed to be.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Patrick Wallek
Honored Contributor

Re: hostname error

Also check and make sure you do not have any backup copies of your netconf file in /etc/rc.config.d Do an 'll netconf*' and if more than netconf comes back, move the other files someplace else.

Do not re-install HP-UX yet. There is no reason to do this. As was said, just be patient.
linuxfan
Honored Contributor

Re: hostname error

Hi,

1. Do this
grep HOSTNAME /etc/rc.config.d/*
(this is to check if there are multiple entries for hostname)

2. Have you tried setting the hostname using "set_parms hostname"
I know you said setting the hostname with "hostname hpd380" seems to be working but try set_parms (would need a reboot)

3. Do a "getip hpd380"
(would return the IP address)
nslookup hpd380
nslookup
Do they point to the same address?

4. Are you using DNS or NIS. In any case make sure your /etc/nsswitch.conf is set up correctly. If you don't have a file in place you can copy it from /usr/newconfig/etc.

5. Are you having a problem loggin in as root and users or only as users?
If you are having a problem loggin in as users make sure the permissions are set ok

-r--r--r-- bin:bin /etc/hosts

-rw-r--r-- root:sys /etc/nsswitch.conf

-rw-r--r-- root:sys /etc/resolv.conf

I would agree with others that this does not need a reinstall of the OS. Atleast not yet.
-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Sanjay_6
Honored Contributor

Re: hostname error

Hi May,

Instead of setting the hostname manually, why don't you try setting up the same theough SAM and see if it helps.

SAM --> Networking and communication --> Network Interface Cards

Select the LAN Port / Card and Select Action ---> Delete
Select the same Again, Action --> Configure, Add the Server name and the aliases. Reboot the box and see if it helps.

Thanks
Rita C Workman
Honored Contributor

Re: hostname error

There are a few places in the system that hold hostname info. You need to ensure that all these places have the correct and same hostname. The best and easiest way to do this is to use the old trustworthly:
set_parms hostname

This will set it properly for your system in all the places it should. Then go back and ensure your /etc/hosts file is typed correctly (do your nslookup for name & IP) and double check your netconf file also...

Just a thought,
Rita
G.Kumar
Frequent Advisor

Re: hostname error

Hi May;

Do "set_parms hostname" and try again.

It will show the hostname correctly while changing hostname don't stop go ahead and type the hostname again(dont press just enter).And it should reboot the system.This could solve your problem.