Andrzej Popielewicz Phd

Applied Informatics Division
Institute of Physics UAM 
Download| Contact 
CV  
Interests   
Projects  
 Modems    
     
     

Solaris 9 x86 : DHCP "unknown" hostname problem

Method 1

The reason , that hostname is set to "unknown" is the fact , that dhcpinfo does not return hostname as expected by system scripts. This is why we propose to change two system scripts :

/etc/rcS.d/S30network.sh
/etc/rcS.d/K42inetsvc

The first of these scripts calls another script

/etc/rcS.d/test.sh

You have to understand how this test.sh script works. The idea is the following : my ISP provider assigns the following hostname to my Solaris box connected via cable modem :

c20-130.icpnet.pl , where icpnet.pl is unique domain name and c20-130 is created from IP address , in my example the IP was 62.21.20.130. It  means the permanent part 62.21 is omitted and replaced by corresponding domain icpnet.pl and the rest corresponding to my host is added. You have to change this part in test.sh script which is ISP provider specific, for example domain.name and the convention to create the rest of hostname. You may for example choose  to set hostname equal to IP address.

Warning : make backup of above two system scripts. Learn recovery procedure before applying these changes. You cannot build in any syntax errors into these scripts. Please test in /sbin/sh environment, and not for example in bash.

Reboot the system after applying these changes.
 
 Download

Method 2

In this method no system scripts are changed. Two scripts are added :
 
/etc/rcS.d/test.sh

It is the same script used in method 2. Then the second script is

/sbin/dhcpinfo

Notice the second script has the same name as original /sbin/dhcpinfo program. Thus before copying this script from the supplied archive into /sbin directory do the following

cd /sbin
mkdir backup
cp dhcpinfo backup
cp dhcpinfo olddhcpinfo


The same remarks as above concerning customizing of test.sh apply  also in this case. Reboot the system after adding these two scripts.

As a result You  should obtain hostname set to the real hostname, assigned to Your PC by Your provider's DHCP server, and under which Your computer is visible/accessible from the Internet  




Document created on  5.1.2004