|
|
#1 |
|
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. |
|
|
|
|
|
#2 |
|
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. |
|
|
|
|
|
#3 |
|
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 |
|
|
|
|
|
#4 |
|
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.
|
|
|
|
|
|
#5 |
|
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.
__________________
Waffled foreheads are a symptom of broken keyboards and inexperienced users
|
|
|
|
|
|
#6 |
|
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. |
|
|
|
|
|
#7 |
|
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
|
|
|
|
|
|
#8 |
|
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... |
|
|
|
![]() |
|
|