<!--
{
  "availability" : [
    "iOS: 9.0.0 - 18.0.0",
    "iPadOS: 9.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.11.0 - 15.0.0",
    "tvOS: 17.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NWHostEndpoint",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NWHostEndpoint"
  },
  "title" : "NWHostEndpoint"
}
-->

# NWHostEndpoint

A network endpoint specified by DNS name (or IP address) and port.

```
class NWHostEndpoint
```

## Topics

### Initializing host endpoints

[`+  endpointWithHostname:port:`](/documentation/NetworkExtension/NWHostEndpoint/init(hostname:port:))

Create a host endpoint with a hostname and port.

### Getting endpoint properties

[`hostname`](/documentation/NetworkExtension/NWHostEndpoint/hostname)

The endpoint’s hostname.

[`port`](/documentation/NetworkExtension/NWHostEndpoint/port)

The endpoint’s port, represented as a string.

## Relationships

### Inherits From

[`NWEndpoint`](/documentation/NetworkExtension/NWEndpoint)

### Conforms To

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

---

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)