1832574 Members
4488 Online
110043 Solutions
New Discussion

Re: Invalid Hostname

 
Halan Leno
Occasional Advisor

Invalid Hostname

After rebooting the server, some inet services doesn't start correctly. And when I ran hostname command the given is unknow. The /etc/hosts is correctly setup. Any help would be appreciated...
18 REPLIES 18
John Palmer
Honored Contributor

Re: Invalid Hostname

The hostname is set in /etc/rc.config.d/netconf check there.

Regards,
John
Pete Randall
Outstanding Contributor

Re: Invalid Hostname

Run the "/sbin/set_parms hostname" command, then reboot. Report back if you're still having problems.


Pete

Pete
RAC_1
Honored Contributor

Re: Invalid Hostname

Also check /etc/rc.config.d/netconf file.

And also /sbin/init.d/hostname file.
There is no substitute to HARDWORK
DIPAK KUMAR ROY
Frequent Advisor

Re: Invalid Hostname

Did you modified hostname entry on /etc/rc.config.d/netconf file ? If so, what is the new name ?

BTW. you can have max 8 characters long hostname.

Thanks
Steven E. Protter
Exalted Contributor

Re: Invalid Hostname

hostname 8 charcaters or less

hebron will work

jerusalem will not

hebron.my.net will work

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rene Mendez_4
Super Advisor

Re: Invalid Hostname

Verify in /etc/rc.config.d only one file exist with name netcof no shuld exist netconf.old

Test change the hostname with set_parms hostname

Regards
Rene
Halan Leno
Occasional Advisor

Re: Invalid Hostname

I still having problems after last boot... I made changes with the command set_parms hostname, and after thart I shutdown the machine again, but many daemon failed.
The major message inside the rc.log is "INDEX: The specified number is not valid for this command"
See attached rc.log file..
Sanjay_6
Honored Contributor

Re: Invalid Hostname

Hi,

Can you attach your /etc/hosts and /etc/rc.config.d/netconf files.

Thanks
Sanjay
Todd McDaniel_1
Honored Contributor

Re: Invalid Hostname

What had you changed before this reboot?

I agree any odd characters in teh /etc/hosts or any number more than 1 verion of netconf in /etc/rc.config.d will cause problems...

In the /etc/hosts, if you have any characters after the hostname it will fail to recognize it.

Check your /var/adm/syslog/syslog.log for any errors related to the hostname.


Your hostname only occurs in those 2 places.
Unix, the other white meat.
Bill Hassell
Honored Contributor

Re: Invalid Hostname

Make sure that your hostname is 8 characters or less. The hostname can be different than a name assigned to the IP address (hostname = UUCP name = uname -n). See the man page for hostname. However, there is an undocumented way to make the hostname long and still comply with the UUCP limit of 8 characters. Edit the file /etc/rc.config.d/netconf and change the line with HOSTNAME to:

HOSTNAME=longnameforipaddress
NODENAME=shorty

In other words, if you can't reduce your hostname as defined in /etc/hosts or your local DNS, then make up a new (short) one and add it to netconf for NODENAME.

As far as the bad index messages, this was caused by standardizing the shells for leading zero behavior. The Unix standard has always been numbers with a zero are always in octal notation. There are some scripts in /etc/init.d that assign leading zero numbers like 08 or 09 to variables and of course, those are not valid octal numbers.


Bill Hassell, sysadmin
Halan Leno
Occasional Advisor

Re: Invalid Hostname

As asked I attached /etc/hosts and /etc/rc.config.d/netconf,
John Palmer
Honored Contributor

Re: Invalid Hostname

One issue is that you have a gap in the array that defines your Network cards.

You have INTERFACE_NAME[0]=
and INTERFACE_NAME[2]=

i.e. [1] is missing.

Try changing the following lines:-
IP_ADDRESS[2]=10.100.0.17
SUBNET_MASK[2]=255.255.0.0
INTERFACE_NAME[2]=lan2
BROADCAST_ADDRESS[2]=""
INTERFACE_STATE[2]=up
DHCP_ENABLE[1]=0
DHCP_ENABLE[2]=0
to:
IP_ADDRESS[1]=10.100.0.17
SUBNET_MASK[1]=255.255.0.0
INTERFACE_NAME[1]=lan2
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=up
DHCP_ENABLE[1]=0

I'd also relocate those lines to follow the definition for lan0 so that it reads:-

INTERFACE_NAME[0]="lan0"
IP_ADDRESS[0]="192.1.1.2"
SUBNET_MASK[0]=255.255.0.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0

IP_ADDRESS[1]=10.100.0.17
SUBNET_MASK[1]=255.255.0.0
INTERFACE_NAME[1]=lan2
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=up
DHCP_ENABLE[1]=0


Sanjay_6
Honored Contributor

Re: Invalid Hostname

Hi Halan,

Change the index no to 1 from 2.

IP_ADDRESS[2]=10.100.0.17
SUBNET_MASK[2]=255.255.0.0
INTERFACE_NAME[2]=lan2
BROADCAST_ADDRESS[2]=""
INTERFACE_STATE[2]=up
DHCP_ENABLE[1]=0
DHCP_ENABLE[2]=0

//Corrections//

IP_ADDRESS[1]=10.100.0.17
SUBNET_MASK[1]=255.255.0.0
INTERFACE_NAME[1]=lan2
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=up
DHCP_ENABLE[1]=0

//End Correction//

Hope this helps.

Regds
Todd McDaniel_1
Honored Contributor

Re: Invalid Hostname

Which lan card are you using for the primary?


IP_ADDRESS[2]=10.100.0.17
SUBNET_MASK[2]=255.255.0.0
INTERFACE_NAME[2]=lan2
BROADCAST_ADDRESS[2]=""
INTERFACE_STATE[2]=up
DHCP_ENABLE[1]=0
DHCP_ENABLE[2]=0


This appears that you are using the secondary one.

What does your netstat -rn show?

Can you do an nslookup on the hostname/ipaddress?
Unix, the other white meat.
Halan Leno
Occasional Advisor

Re: Invalid Hostname

Hi..

The primary lan is [2], I think very strange what is happening because I didn't make any changes in my environment... Also I saw a issue about /sbin/rc.utils (script) that show some changes below, and proactively a did this changes as recommended.

let ROWS="${rows##*(0)}"
let COLS="${cols##*(0)}"

Another information, after boot the result of hostname command back to unknow.

Thanks in advance...

Halan Leno
Halan Leno
Occasional Advisor

Re: Invalid Hostname

Hi Todd.

The result of netstat -rn is what we expected or it is working fine.. About nslookup is working without problems too.

Thanks
John Palmer
Honored Contributor

Re: Invalid Hostname

One other possibility, check if there are any other files in /etc/rc.config.d which declare a variable called HOSTNAME. Almost all the files in this directory get run by initialisation scripts.

Try the following to identify them:-
cd /etc/rc.config.d
grep -l "HOSTNAME=" *

You should only see netconf reported.
Halan Leno
Occasional Advisor

Re: Invalid Hostname

Hi..

About the result of command grep it really showed netconf. But I found the problem in nddconf file, that had missing configuration.I found it using sh -x /etc/rc.config and i looked inside it, and check that had something wrong in nddconf file..

Now is everything, working fine..

Thanks for all..

Halan Leno