[MacTUG] Inconsistent results from hostname Unix command via ARD
Dani Roloson
daroloso at mfcf.math.uwaterloo.ca
Thu Jun 28 13:48:17 EDT 2007
> I sometimes get the DNS name and sometimes get the local sharing name
> i.e. mfcfmac01.math.uwaterloo.ca vs. Dani-Roloson.local
>
> Any ideas on how to get it to consistently return the DNS name?
> Setting the sharing name to the DNS name won't work since it appends .local
> plus the primary user name for sharing is desirable.
I think Matthew Oliver gets the brownie point for pointing out
scutil --set HostName servername.example.com
as root will do the job. I haven't checked yet whether this is truly
persistent. The preferences ComputerName and LocalHostName came in
handy since I discovered several hosts where one was "Dani Roloson" and
the second wasn't "Dani-Roloson".
So the next question is can one get the Mac to cough up its DNS name or
IP address without major acrobatics.
For example
% ifconfig en0 inet
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 129.97.111.74 netmask 0xffffff00 broadcast 129.97.111.255
but I only want the 129.97.111.74 and
% host 129.97.111.74
74.111.97.129.in-addr.arpa domain name pointer mfcfmac01.math.uwaterloo.ca.
but I only want mfcfmac01.math.uwaterloo.ca
Dani
More information about the MacTUG
mailing list