<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWEndpoint/Host",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network10NWEndpointO4HostO"
  },
  "title" : "NWEndpoint.Host"
}
-->

# NWEndpoint.Host

A name or address that identifies a network endpoint.

```
enum Host
```

## Topics

### Creating Hosts

[`init(_:)`](/documentation/Network/NWEndpoint/Host/init(_:))

Initializes a host with a string.

### Accessing Host Types

[`NWEndpoint.Host.name(_:_:)`](/documentation/Network/NWEndpoint/Host/name(_:_:))

A host represented as a name.

[`NWEndpoint.Host.ipv4(_:)`](/documentation/Network/NWEndpoint/Host/ipv4(_:))

A host represented as an IPv4 address.

[`NWEndpoint.Host.ipv6(_:)`](/documentation/Network/NWEndpoint/Host/ipv6(_:))

A host represented as an IPv6 address.

### Requiring Interfaces

[`interface`](/documentation/Network/NWEndpoint/Host/interface)

The interface associated with this host, such as the interface scope stored in an IPv6 address.

### Comparing Hosts

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)