There are many webpages given over to listing defaults commands in order to configure various parts of the OS. Some of them include the flag -currentHost.

The man page for the defaults command documents the option -currentHost, as "restricting preferences operations to the host that the user is currently logged in on."

Similarly, the -host flag allows a hostname to be specified for the preference.

What is the purpose of explicitly setting these flags? Under what circumstances would a preference affect some other host? (Or indeed, when would a user be logged in on a different host?)

2 Answers 2


In the case of networked accounts and networked home folders, a user can login to any Mac on, for example, a company network and see their own files and have their own preferences set.

This is the case where you can use the -host feature. Say that you want, for example, one wallpaper on your own desktop, but another when you login to the shared office Mac in the meeting room. Or any other type of setting than wallpaper of course.

  • But if you're using a networked account, then surely the user Library's preferences will already apply, no matter what computer you log in on?
    – benwiggy
    Mar 10, 2019 at 18:52
  • @benwiggy Mobile accounts used to have synchronized home folders, so the currentHost value was intended to be sticky and not mobile. You can also have a network / mounted home folder (or even parts of the home folder) in some cases. What's the real question you are asking or is this just a curiosity and literally "how did we get here" type of question?
    – bmike
    Mar 10, 2019 at 19:23
  • Yes, just idle curiosity. So in other words, for "normal" installations of MacOS, the -currentHost flag is pretty meaningless and vestigial.
    – benwiggy
    Mar 10, 2019 at 19:28
  • @benwiggy Yes, it's only usuable if you have multiple computers that you login to, and your home folder is stored on a central server.
    – jksoegaard
    Mar 10, 2019 at 19:36
  • Certain applications will only utilize currentHost defaults (such as com.apple.notificationcenterui dndEnabledDisplaySleep) and ignore defaults set without currentHost
  • currentHost is also relevant in the case of networked accounts and networked home folders (see jksoegaard's answer if interested in details).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .