Hostname is unknown when using dhcp

Hostname is unknown when using dhcp

Post by Dan Smit » Thu, 20 Sep 2001 02:25:34



Can someone tell me how to tell the machine (solaris 8) what the
hostname is when it uses DHCP?  I put "flare" in /etc/hostname.elxl0
but it still comes up with hostname "unknown".  Can someone also tell
me how to disable DHCP and hard-code the IP after a system has been
installed with DHCP on?

--Dan

 
 
 

Hostname is unknown when using dhcp

Post by Wazir Shpoo » Thu, 20 Sep 2001 02:37:23


Here is the info doc from sun on this.  It worked for me:

1. For Solaris 2.6 and Solaris 7 Systems.

Edit the file /etc/init.d/rootusr and change the line that reads

 hostname=`/sbin/dhcpinfo Hostname`

to

# hostname=`/sbin/dhcpinfo Hostname`
hostname=`shcat /etc/nodename`
uname -S $hostname

Save the file and reboot the system. The system's hostname will be the
entry in the file /etc/nodename.

2. For Solaris 8 systems.

Edit the file /etc/init.d/network  and change the line that reads

"dhcp") hostname=`/sbin/dhcpinfo Hostname` ;;

to

# "dhcp") hostname=`/sbin/dhcpinfo Hostname` ;;
"dhcp") hostname=`shcat /etc/nodename` ;;

Then, edit the file /etc/init.d/inetsvc and change the line that reads

 hostname=`/sbin/dhcpinfo Hostname`

to

# hostname=`/sbin/dhcpinfo Hostname`
hostname=`/usr/bin/cat /etc/nodename`

HTH

-Wazir
Save the files and reboot the system. The system's hostname will be the
entry in the file /etc/nodename.

Quote:> Can someone tell me how to tell the machine (solaris 8) what the
> hostname is when it uses DHCP?  I put "flare" in /etc/hostname.elxl0
> but it still comes up with hostname "unknown".  Can someone also tell
> me how to disable DHCP and hard-code the IP after a system has been
> installed with DHCP on?

> --Dan


 
 
 

Hostname is unknown when using dhcp

Post by Logan Sh » Thu, 20 Sep 2001 04:56:43




Quote:>Can someone tell me how to tell the machine (solaris 8) what the
>hostname is when it uses DHCP?  I put "flare" in /etc/hostname.elxl0
>but it still comes up with hostname "unknown".

This has been answered numerous times in this group.  Here's a search
on Google's Usenet archive that gives several answers:

        http://www.veryComputer.com/%20unknown%20dhcp&as_ugr...

Quote:> Can someone also tell
>me how to disable DHCP and hard-code the IP after a system has been
>installed with DHCP on?

"ifconfig elxl0 dhcp drop" to turn it off right now.

"rm /etc/dhcp.elxl0" to make it not turn on at next boot.

  - Logan
--
"Everybody
 Loves to see              
 Justice done
 On somebody else"     ( Bruce*burn, "Justice", 1981 )

 
 
 

Hostname is unknown when using dhcp

Post by Dan Smit » Thu, 20 Sep 2001 04:59:54


OK, if I remove the /etc/dhcp.elxl0 file, how do I tell it what IP to
use at startup next time?

Thanks!

--Dan




> >Can someone tell me how to tell the machine (solaris 8) what the
> >hostname is when it uses DHCP?  I put "flare" in /etc/hostname.elxl0
> >but it still comes up with hostname "unknown".

> This has been answered numerous times in this group.  Here's a search
> on Google's Usenet archive that gives several answers:

>    http://www.veryComputer.com/%20unknown%20dhcp&as_ugr...

> > Can someone also tell
> >me how to disable DHCP and hard-code the IP after a system has been
> >installed with DHCP on?

> "ifconfig elxl0 dhcp drop" to turn it off right now.

> "rm /etc/dhcp.elxl0" to make it not turn on at next boot.

>   - Logan
> --
> "Everybody
>  Loves to see              
>  Justice done
>  On somebody else"     ( Bruce*burn, "Justice", 1981 )

 
 
 

Hostname is unknown when using dhcp

Post by Logan Sh » Thu, 20 Sep 2001 05:01:54




Quote:>OK, if I remove the /etc/dhcp.elxl0 file, how do I tell it what IP to
>use at startup next time?

You put it in /etc/hostname.elxl0.  Or, you put the hostname in
/etc/hostname.elxl0 and an entry matching up that hostname and IP
address in /etc/hosts.

You probably also want to know about /etc/defaultrouter, and maybe
/etc/nsswitch.conf and /etc/resolv.conf, if you don't already know
about those.  "man defaultrouter" "man nsswitch.conf", and "man resolv.conf"
will get you information on those.

  - Logan
--
"Everybody
 Loves to see              
 Justice done
 On somebody else"     ( Bruce*burn, "Justice", 1981 )

 
 
 

Hostname is unknown when using dhcp

Post by Dan Smit » Thu, 20 Sep 2001 05:04:35


I already knew about everything but the default router file.  Thanks.
That's great.

As for the /etc/hostname.elxl0... What do I put in that file?  Right
now it's empty.  If I do man hostname it of course gives me the
manpage for /usr/bin/hostname.

Thanks!

--Dan




> >OK, if I remove the /etc/dhcp.elxl0 file, how do I tell it what IP to
> >use at startup next time?

> You put it in /etc/hostname.elxl0.  Or, you put the hostname in
> /etc/hostname.elxl0 and an entry matching up that hostname and IP
> address in /etc/hosts.

> You probably also want to know about /etc/defaultrouter, and maybe
> /etc/nsswitch.conf and /etc/resolv.conf, if you don't already know
> about those.  "man defaultrouter" "man nsswitch.conf", and "man resolv.conf"
> will get you information on those.

>   - Logan
> --
> "Everybody
>  Loves to see              
>  Justice done
>  On somebody else"     ( Bruce*burn, "Justice", 1981 )

 
 
 

1. unknown hostname on a station using DHCP

As soon as I enable DHCP by creating a file /etc/dhcp.hme0, the hostname is
unknown.
The DHCP server is a router, which does not provide an hostname.
My station is an ultrasparc 5 running on solaris 9.

I defined a hostname in /etc/hostname.hme0:
inet <hostname>

I tried to change the options of /etc/default/dhcpagent, unsuccessfully.

If I set hostname by using the command hostname, I cannot login under CDE.

So I would be grateful if somone can provide me with an advice.

2. PICO word-wrap

3. Unknown hostname using DHCP and Solaris 8

4. mail server routing info

5. Gnome using DHCP client and hostname resolver problem using RH 6.2

6. log rotate

7. Newbie how to add telnet+ftp to custom 2.0.36 distro?

8. Hostname: unknown / DHCP probs

9. solaris DHCP client hostname unknown

10. DHCP sets hostname "unknown"

11. HELP - DHCP hostname for my workstation is "unknown"

12. Boot error message: My unqualified hostname (hostname) unknown; sleeping for retry...