Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Override Host name assigned by DHCP?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Override Host name assigned by DHCP?
Authored by: Schwie on Oct 22, '04 09:01:07PM
Please help me oh friendly and all-knowing 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.

[ Reply to This | # ]

Override Host name assigned by DHCP?
Authored by: Schwie on Mar 16, '06 10:15:40PM

This is advice from Trevor in the Forums and the only thing that ended up getting things to work for me:

Open "" and at the prompt enter:

cd /etc
sudo pico hostconfig

Enter your password and modify the line that says:



HOSTNAME=mnm_bschwie (or whatever you want)

Press Control and X to get out and save you changes.

You may need to do a restart to make these changes go in to effect.

[ Reply to This | # ]