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

# SCDynamicStoreKeyCreateHostNames(_:)

Creates a key that can be used to receive notifications when the `HostNames` entity changes.

```
func SCDynamicStoreKeyCreateHostNames(_ allocator: CFAllocator?) -> CFString
```

## Parameters

`allocator`

The allocator that should be used to allocate memory for this key. This parameter may be `NULL` in which case the current default allocator is used. If this value is not a valid <doc://com.apple.documentation/documentation/CoreFoundation/CFAllocator>, the behavior is undefined.

## Return Value

A notification string for the `HostNames` entity.

## Discussion

Use this key with the [`SCDynamicStoreSetNotificationKeys(_:_:_:)`](/documentation/SystemConfiguration/SCDynamicStoreSetNotificationKeys(_:_:_:)) function. Note that the `HostNames` entity includes the local host name.

---

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)