Is it possible to ignore a DHCP-supplied hostname? I have my hostname set via the System Preferences->Sharing pane, and like it that way. When I connect to my network at work (which has a DHCP server configured to pass down hostnames), my hostname in my shell is the nasty VLAN info string configured by my network admins. I'd like it to remain my own, attractive hostname. 🙂
I know I can configure myself with a static IP, but I don't really see a need for that.
Is there anything like /etc/dhclient.conf on Linux systems? Can I somehow tell OS X to ignore the DHCP-supplied hostname, like I can tell dhclient systems?
If it's just to keep your shell prompt consistent, maybe you could set it in a login script? I did this recently for a bunch of laptops that we send to trade shows. Works well. I could post the code if you'd like. Don't remember it off the top of my head.
If it's just to keep your shell prompt consistent, maybe you could set it in a login script? I did this recently for a bunch of laptops that we send to trade shows. Works well. I could post the code if you'd like. Don't remember it off the top of my head.
There's a key for hostname and its value is -AUTO-. Change the value to your hostname of choice. Just remember that in your case DNS will have whatever is supplied by DHCP for your hostname, so if you provide any services, clients will have to use that hostname, not your local one.
That appears to be it. My /etc/hostconfig doesn't have a HOSTNAME entry, but I can add one.
I know it only changes for my local system. I'm on a laptop, so I tend not to run permanently active services. I'm part of the support staff, so I don't need inbound remote admin access. 🙂