Posted on 05-05-2014 09:21 AM
Hi Everyone,
Has anyone seen an issue where computers get renamed to "localhost" on 10.9.2 and the latest version of the JSS?
I saw this thread here: https://jamfnation.jamfsoftware.com/discussion.html?id=5078, but I'm not sure it still applies. The .plist file it references isn't present in my base image that I created with AutoDMG. Any thoughts that people have would be great!
Solved! Go to Solution.
Posted on 05-05-2014 10:37 AM
I ran into this in my test environment. For me it was a Configuration Profile. In CP under the Login Window section, choose Options, and it was the "Set computer name to computer record name" that was erasing the name and putting localhost in the computer name field. It didn't modify the .local name in the Sharing pane.
My account rep was going to look into recreating it but don't know if he did. I didn't look at the log file to see if there was anything in there however.
Posted on 05-05-2014 09:39 AM
It looks like I've found the relevant log line:
5/4/14 2:43:24.961 PM mDNSResponder[65]: User updated Computer Name from “mac-sosnovsken” to “localhost”
Posted on 05-05-2014 10:37 AM
I ran into this in my test environment. For me it was a Configuration Profile. In CP under the Login Window section, choose Options, and it was the "Set computer name to computer record name" that was erasing the name and putting localhost in the computer name field. It didn't modify the .local name in the Sharing pane.
My account rep was going to look into recreating it but don't know if he did. I didn't look at the log file to see if there was anything in there however.
Posted on 05-05-2014 11:03 AM
I have lots of computers that seem to have changed their name from our standard naming scheme to "localhost". It doesn't seem to be limited to Mavericks computers. Not sure what the cause is at this point.
Posted on 05-05-2014 11:22 AM
Preliminary results seem to show Brad_G's solution working perfectly. That is a really odd place for apple to put that setting... and I think it gets set by default.
I'll mark this as the answer and chime back in if it starts up again.
edit: nevermind, it doesn't get set by default. I must have just been click happy.
Posted on 06-05-2014 10:18 AM
I am having the same issue. I now have 200+ computers called localhost. I noticed that the dns name and remote management names are unchanged. Could anybody who is good with scripts write one for me to change the computer name to match the dns name?
Posted on 06-05-2014 10:25 AM
This should do it. Just scope it to a smart group where computers have name localhost:
#!/bin/sh
SETNAME=`scutil --get LocalHostName`
jamf setcomputername -name $SETNAME
exit 0
Posted on 06-06-2014 07:58 AM
@sosnovsken Thank you so much! Your script worked like a charm.
I tried to write a script to fix it and all it did was make things more confused. Luckily I only scoped my attempts to my office computers, lol.
Posted on 07-03-2014 07:56 PM
Syntax error in the script?
Script result: /Library/Application Support/JAMF/tmp/localhostfix.sh: line 1: {rtf1ansiansicpg1252cocoartf1265cocoasubrtf190: command not found /Library/Application Support/JAMF/tmp/localhostfix.sh: line 2: syntax error near unexpected token `}' /Library/Application Support/JAMF/tmp/localhostfix.sh: line 2: `{fonttblf0fmodernfcharset0 Courier;}'
Posted on 07-14-2014 09:34 AM
I don't think so... this is about as basic as it gets. Did you get a curly brace inserted somehow (per the unexpected token } line that you got)?
Posted on 07-14-2014 04:52 PM
Posted on 03-31-2015 07:02 AM
Hi. The script worked wonders. However, the name changes back to "localhost." I've uninstalled and reinstalled the Casper client on the computers where it's happening, but that didn't help. Thoughts?