The UNKNOWN hostname problem...

I have just installed Solaris 10 today, and no matter what I do, I can't get the hostname to be anything other than UNKNOWN.

Here's a little about the setup (in the hope that it will help isolate the problem):

When installed, DHCP was chosen. I use a SmoothWall firewall which is also my DHCP server. No DNS/NIS etc was specified. The machine (an Ultra30) connects to SmoothWall via a Netgear switch. At present there are no other devices on the network and I am getting the IP 192.168.0.197. Everything works OK, but I need to set a hostname.

I have set the following values in these files:

/etc/hostname.hme0:

inet system3cs

/etc/hosts:

192.168.0.197 system3cs #Manually Configured Address

/etc/default/dhcpagent:

inet system3cs

also tried both {

REQUEST_HOSTNAME=yes

} and {

REQUEST_HOSTNAME=no

}

as well as putting a # in front of it

Any further ideas guys? I'm seeing a lot of simillar fixes for Solaris 8 & 9 but I gather they don't work?

[1062 byte] By [Antnee] at [2007-11-26 0:45:30]
# 1

Have you tried out this link here:

http://www.rite-group.com/consulting/solaris_dhcp.html

I have manage to get it work on Solaris 10 b72 x86, and also on earlier versions of solaris.

It's a script which reads the hostname from /etc/nodename, and sets it with uname. Needs to be run right after network is configurered.

The only thing missing is updating /etc/hosts, so I fixed it by echo'ing :

echo "X.X.X.Xhostnamehostname.domain.com" >> /etc/hosts

I also made the script start/stop-able, so when shutting down it restores an original copy of /etc/hosts, fx. /etc/hosts.orig.

Hope this helps you :-)

Yngve Berthelsen

UNIX Administrator

Nord Data A/S

Denmark

(one a Sun Engineer for Sun Microsystems Denmark)

Yngve_Berthelsen at 2007-7-5 19:40:54 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2
.. and remember, use svcadm to enable and configure the service , as the old init.d style isn't used in solaris 10 /Yngve
Yngve_Berthelsen at 2007-7-5 19:40:54 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3

Hi,

This might be a sign of my ignorance, but I've always

thought that /etc/hostname.xxx files contain a single

word, the hostname. That's Solaris 8,9 and 10

# cat /etc/hostname.hme0

ten

#

Looking at the boot scripts in /etc/init.d:

# cd /etc/init.d

# grep -l '/etc/hostname\.' *

ncakmod

There's only script, ncakmod, that uses /etc/hostname.xxx. And I *think* the script is written

to expect a single word. This is from ncakmod:

readifconf()

{

while read i; do

case "$i" in

'#'* | '')# Ignore comments, empty lines

continue ;;

'*')configinterfaces="`echo /etc/hostname.*[0-9] \

2>/dev/null`"

checkforvirt=false

break ;;

esac

configinterfaces="$configinterfaces $i"

done

}

kidari at 2007-7-5 19:40:54 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4

One other 'feature' in S10 is that /etc/inet/ipnodes

is populated on install (in build 74, at least), so

you need to edit that as well as /etc/inet/hosts and

/etc/nodename to change the name.

/etc/inet/ipnodes is for IPv6 addresses, but

can contain IPv4 ones too. It's been around

a while, but is only populated in S10....

kidari at 2007-7-5 19:40:54 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 5

Well the problem is, when you have DHCP on fx. hme0, your hostname.hme0 doesn't hold your hostname, instead, you use the file dhcp.hme0, but it can not hold the hostname, as solaris networking doesn't look for it. If DHCP is corrently set up, you can manage to retrieve the hostname following the ip address, and have it set automatically.

But if it doesn't , you need to do it yourself.

dhcp-client looks for the file dhcp.hme0, if it does not exist, the dhcp client will not start, but if it find dhcp.hme0 it will start, but it will not use hostname.hme0

If you edit /etc/hosts or /etc/inet/hosts, you need to be sure what your ip address is, if your host gains different IP addresses every time it connects with dhcp client, you must supply the hosts-file with that ip address.

Yngve_Berthelsen at 2007-7-5 19:40:54 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 6

Yngve, many thanks, that has worked a treat! One day I may get around to setting up a domain controller, but the honest truth is that it strikes me as a bit overkill when there are only 4 machines on this network! I guess it will be good practice though, getting Windows and Solaris working happily together on a wired AND wireless network!

Thanks again

Antnee at 2007-7-5 19:40:54 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 7

Hi Guys,

I want to thank all for the valuable information.

I thought of sharing my own comments.

I have two SunSparc Ultra10 machines. I want to network them together using a Linksys router (Cisco) so they could communicate and also to be able to access the Internet. I let the router to do the (DHCP) work, however; since the routher doesn't send hostname I always got 'unknown' and I need to have proper hostname to do my training work. So, I've read this page and I thought I could contribute the result of my work.

(assuming my hostname= sys41)

On Solaris 10, all what I did,

1. On /etc/hostname.hme0 .. I've added,

inet sys41

2. I've created /etc/nodename .. and added,

sys41

3. On /etc/default/dhcpagent .. added,

REQUEST_HOSTNAME=yes

actualy, it was there, I just removed the comment (#) and changed it from no to yes

and double checked that I have ,

PARAM_LIST=1,3,6,12,15,28,43

That's all, I didn't need to change anything else nor add any script file or anything.

The following files where not there on my Solaris10 machine,

/etc/init.d/network

/etc/init.d/inetsvc

On Solaris 9,

1. On /etc/hostname.hme0 .. I've added,

inet sys41

2. I've created /etc/nodename .. and added,

sys41

3. On /etc/default/dhcpagent .. added,

REQUEST_HOSTNAME=yes

actualy, it was there, I just removed the comment (#) and changed it from no to yes

and double checked that I have ,

PARAM_LIST=1,3,6,12,15,28,43

I had to add 15,6,28 on my Solaris 9

4. /etc/init.d/network

changed all 'unknown' to 'sys41' which is my hostname

5. couldn't find /etc/init.d/inetsvc !

Then I've deleted /etc/nodename on Solaris 9.0 and still worked fine ..

On Solaris 10, I've deleted /etc/nodename and it didn't work.

So, I guess for Solaris 10 /etc/nodename is very important .. For the Solaris 9, /etc/inet.d/network did the job !!

Hope my comments were helpful... Regards ..

bright09 at 2007-7-5 19:40:54 > top of Java-index,Solaris Operating System,Solaris 10 Features...