Go Back   The macosxhints Forums > OS X Help Requests > Networking



Reply
 
Thread Tools Rating: Thread Rating: 15 votes, 5.00 average. Display Modes
Old 10-22-2004, 09:06 PM   #1
schwie
Prospect
 
Join Date: Sep 2004
Location: Saint Paul, MN
Posts: 13
DHCP/hostname problem

Please help Unix/Mac OS X gods. My hostname keeps getting over-written every time I join the network at work.

Here's the situation.

I am joining my network at work, via DHCP, by either wifi or ethernet. Every time I join the network, DHCP forces a hostname on me. How do I know this? I fire up Terminal and it reads out not one but 2 other hostnames of computers on our network at the Terminal prompt:

[mnx_oandersonmnx_jsmith:~] bschwie%

At first, I didn't care about it, but after I tried printing, I soon realized that I was unable to print, the error in Print Center mentioning something about a "control file".

To work around this situation, each time I hop on the network at work, I open up Terminal and perform the following:

[mnx_oandersonmnx_jsmith:~] bschwie% su

mnm_bschwietibook:/Users/bschwie root# hostname mnm_bschwie

after exiting from root mode, quitting Terminal, and then re-opening Terminal, I see that my changes have taken hold and my prompt now looks like it should have in the first place:

[mnm_bschwie:~] bschwie%

The problem with this workaround is, whenever I leave for the day, and come back to work the next, the hostname has re-set itself again.

Man, this is not good... Please help! Is this something I should be changing in NetInfo.

Also, I made the hostname "mnm_bschwie" the hostname in the Sharing Control Panel. Still, this doesn't seem to help my problem of acquiring former hostnames on the network at work.

If it matters at all, I'm getting a DHCP lease from a Windows 2000 Server.

[mnx_oandersonmnx_jsmith:~] bschwie%

Last edited by schwie; 10-22-2004 at 09:53 PM.
schwie is offline   Reply With Quote
Old 10-22-2004, 10:39 PM   #2
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
My first suggestion would be to make sure that your DHCP Client ID (in the Network prefpane) and your Computer Name (in Sharing prefpane) are the same. This should get you registered on the DHCP network with a proper DNS entry.
If that doesn't help:
Secondly, you need to talk to your network admins. When you get on the network and you get someone else's hostname, it's because it's likely that the DHCP release time is far too low, and you're not getting the same IP every day, which you should if you're going to work every day.
yellow is offline   Reply With Quote
Old 10-22-2004, 10:43 PM   #3
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,853
With a Unix-friendly editor, edit the file /etc/hostconfig as root and change the line that says

HOSTNAME=-AUTOMATIC-

to read

HOSTNAME=mnm_bschwie

Trevor
trevor is offline   Reply With Quote
Old 10-23-2004, 11:40 PM   #4
schwie
Prospect
 
Join Date: Sep 2004
Location: Saint Paul, MN
Posts: 13
I love you guys! Thanks for the advice! I'm not going to be back in the office for atleast a week, so I'll try it when I get there... I'll try to post again when I test out the hacks.
schwie is offline   Reply With Quote
Old 10-25-2004, 10:57 AM   #5
Raven
Hall of Famer
 
Join Date: Jul 2003
Location: Montreal
Posts: 4,782
I have a question on Yellow's reply:

Code:
My first suggestion would be to make sure that your DHCP Client ID (in the Network prefpane) and your Computer Name (in Sharing prefpane) are the same. This should get you registered on the DHCP network with a proper DNS entry.
I can see the Computer name in the Sharing prefpane, but I can't find anything in Network about DHCP client ID... Could you explain a bit more please ? Thanks (running 10.3.5 fully updated)
__________________
Waffled foreheads are a symptom of broken keyboards and inexperienced users
Raven is offline   Reply With Quote
Old 10-25-2004, 11:23 AM   #6
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
If you're getting your IP address via DHCP it should be there.

See "ron-osxtest3" in the picture below.
Attached Thumbnails
Click image for larger version

Name:	NetworkPrefpane.jpg
Views:	1734
Size:	77.0 KB
ID:	245  
yellow is offline   Reply With Quote
Old 10-25-2004, 11:42 AM   #7
Raven
Hall of Famer
 
Join Date: Jul 2003
Location: Montreal
Posts: 4,782
I'm using DHCP with manual IP, so I have my answer... Also even if I put it to DHCP I don't get a client ID... but I saw that its nbot a required field... Thanks !
__________________
Waffled foreheads are a symptom of broken keyboards and inexperienced users
Raven is offline   Reply With Quote
Old 11-03-2004, 04:33 PM   #8
schwie
Prospect
 
Join Date: Sep 2004
Location: Saint Paul, MN
Posts: 13
What worked...

So, I tried the advice you guys gave me, and the only thing that would work was going into:

/etc/hostconfig

by using the command:

sudo pico hostconfig

and modifying the line that says:

HOSTNAME=-AUTOMATIC-

to:

HOSTNAME=mnm_bschwie

Thanks again! Your advice saved the day!

Still, its unfortunate that this problem plagues Mac OS X. Or maybe its the FreeBSD underpinnings, but still...
schwie is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.