Where is `defaults -currentHost write domain key value` written to?
If you use -currentHost with defaults it acts on .plist files in:

$HOME/Library/Preferences/ByHost/


As an example, I did not have a com.apple.finder plist file at that location and when I executed the following command, one was created at that location.

defaults -currentHost write com.apple.finder GoToField "/foobar"




$ defaults -currentHost read com.apple.finder GoToField
/foobar
$




Note the full file name contains a UUID however you do not need to include it when -currentHost is used, the normal naming is all that's needed as shown in the command line above.

Example: $HOME/Library/Preferences/ByHost/com.apple.finder.6966D045-28DC-544A-97C2-98CDB668DC8B.plist