Re: Hostnames
Re: Hostnames
- Subject: Re: Hostnames
- From: Jens Alfke <email@hidden>
- Date: Wed, 04 Jan 2017 09:10:08 -0800
On Jan 3, 2017, at 11:50 PM, Andreas Fink < email@hidden> wrote:
I have a very weird situation where I installed a new mac by restoring a timemachine backup of my previous mac. The hostname keeps coming back from the old mac, despite the new name being set with the hostname command or with the "Sharing" preference pane.
I had a similar situation a few weeks ago after changing my LAN to use a new router (supplied by AT&T.) It appears that the DHCP server in the router assigns a hostname to my computer for some reason, and this takes precedence over the Bonjour/mDNS hostname set in the Sharing system pref.
What are you using the hostname string for? In my case I specifically need the mDNS (“.local”) hostname, so I switched to using a SystemConfiguration API call to retrieve it, instead of calling hostname().
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden