<!--
{
  "availability" : [
    "macOS: 10.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SystemConfiguration",
  "identifier" : "/documentation/SystemConfiguration/SCDynamicStoreCopyComputerName(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "System Configuration"
    ],
    "preciseIdentifier" : "c:@F@SCDynamicStoreCopyComputerName"
  },
  "title" : "SCDynamicStoreCopyComputerName(_:_:)"
}
-->

# SCDynamicStoreCopyComputerName(_:_:)

Returns the current computer name.

```
func SCDynamicStoreCopyComputerName(_ store: SCDynamicStore?, _ nameEncoding: UnsafeMutablePointer<CFStringEncoding>?) -> CFString?
```

## Parameters

`store`

The dynamic store session that should be used for communication with the server. Pass `NULL` to use a temporary session.

`nameEncoding`

A pointer to memory that, on output, is filled with the encoding associated with the computer or host name, if it is non-`NULL`.

## Return Value

The current computer name, or `NULL` if the name has not been set or if an error occurred. You must release the return value.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)