My mac computer's localhost ip3/12/2024 ![]() The localhost is not always directly identified with your computer. And it overrides the "automatic" system Apple has in place for the output of `hostname`, a system that has known failure modes in certain DNS configurations.The first point to make when explaining what a localhost is, is that it is always your own computer: when you call the localhost, your computer is talking to itself. This script names all three names defined in SystemConfiguration/ist. This would only work for the boot disk, as no targets are set, but that is not a problem for enroll.sh. Grep -q "hostname=" /etc/hostconfig 2> /dev/null || echo "hostname=$newname" > /etc/hostconfig The beginning of Enroll/enroll.sh can be changed to the following: ``` I also noticed, that the value returned by `hostname` is the only name that gets set when `/etc/hostconfig` has a "hostname=" entry.Īt this point, I don't think the `jamf setComputerName` nor the Casper Imaging tool handle all the possible cases to ensure the proper name is set on first boot. The scutil naming tool does update the "ServerDescription" key to the same value as ComputerName. The former, while it updates three of the names (ComputerName, HostName, and LocalHostName), it does not update SystemConfiguration/.plist. I noticed a difference between `sudo jamf setComputerName` and running `sudo scutil -set ComputerName`. Casper Imaging 8.6 Not Naming Computer."Casper not setting computer name when imaging Mountain Lion"."Hostname, Computer name, and Local Hostname. ![]() Daniel handles it by deleting stuff in SystemConfiguration/ist and .plist then letting the post imaging scripts set the name. ![]() ![]() What is the best way to accomplish that? Under old UNIX it would /etc/hostconfig or in /etc/hosts, but those are depreciated files in OS X. PROPOSED SOLUTION: Set the ComputerName, HostName and LocalHostName to the same thing and set them before the network is activated. This results in FQDN being used if the network is available or localhost if it is not. At some point in the imaging process, the computer is checking into JSS without having a ComputerName or HostName set. If the IP address did not return a FQDN when checked in DNS, then `hostname` was set to "localhost" which consequently made its way to the JSS.ĬONCLUSION: Recon uses ComputerName if available, then HostName, and finally `hostname` to update the Computer Name field in JSS. I also discovered why some computers were getting named "localhost". When I ran recon, Computer Name was set to hostname`. When I set all three names to "", the FQDN became the output of `hostname. When I ran `jamf recon` the JSS Computer Name changed to "mylaptop-hostname". Upon reboot ComputerName and LocalHostName were still "" and HostName was "mylaptop-hostname". I then set the ComputerName and LocalHostName to "", and set HostName to "mylaptop-hostname". So how does the name in JSS get changed to an undesired name? When I ran recon with the HostName set to "", JSS kept the same Computer Name. There are FOUR DIFFERENT names a Mac OS X computer can have. NOTE: The results of `hostname` do not always match HostName. When I changed HostName to "", then results of the hostname` command become the FQDN name, which didn't match the ComputerName. When I ran `sudo jamf recon, the JSS record did not change. In other words, DNS returned a different name than the names set on the laptop.Īfter rebooting, this is what I found: $ networksetup -getinfo "USB Ethernet" | grep "^IP address" On the DNS server I created A and PTR records for the IP address being handed out to my test laptop's Ethernet port. It also had the same entry in JSS verified through the web interface. On the laptop I verified that my machine had the same HostName, LocalHostName, and ComptuerName as outputted by scutil. By my convention, all CamelCase words indicate the value was derived from the scutil tool.įQDN for laptop's IP:. Here are the results of some experimentation with a MacBook Air running OS X 10.8.3. It is sometimes localhost and it is sometimes a name that can be found on our DNS. OBSERVATIONS: The incorrect name, when not caused by human error or abused admin rights, is invariably related to DNS. Most of the time this happens immediately after imaging. Sometimes this happens to a machine that has been in the wild. PROBLEM: Some of the names for computers in JSS do not match our organization's naming convention. RESULT SUMMARY: The output of `scutil -get ComputerName` needs to be set correctly before running `jamf recon` in order for the Computer Name in JSS not to be set incorrectly. ![]() Alternate Title: "Notes On Becoming More Familiar With How JSS Determines A Computer's Name" ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |