# EndpointHostHelpers Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [EndpointHostHelpers](/reference/api/csharp/aspire.hosting/endpointhosthelpers.md)
- Kind: `Methods`
- Members: `8`

Provides helper methods for validating localhost addresses.

## IsDevLocalhostTld(string?)

- Name: `IsDevLocalhostTld(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L58)

Determines whether the specified host ends with ".dev.localhost".

```csharp
public static class EndpointHostHelpers
{
    public static bool IsDevLocalhostTld(
        string? host)
    {
        // ...
    }
}
```

## Parameters

- `host` (`string?`)
  The host to check.

## Returns

`bool` -- `true` if the host ends with ".dev.localhost" (case-insensitive); otherwise, `false`.

## IsDevLocalhostTld(Uri?)

- Name: `IsDevLocalhostTld(Uri?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L82)

Determines whether the specified URI uses a host that ends with ".dev.localhost".

```csharp
public static class EndpointHostHelpers
{
    public static bool IsDevLocalhostTld(
        Uri? uri)
    {
        // ...
    }
}
```

## Parameters

- `uri` (`Uri?`)
  The URI to check.

## Returns

`bool` -- `true` if the host ends with ".dev.localhost" (case-insensitive); otherwise, `false`.

## IsLocalhost(string?)

- Name: `IsLocalhost(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L22)

Determines whether the specified host is "localhost".

```csharp
public static class EndpointHostHelpers
{
    public static bool IsLocalhost(
        string? host)
    {
        // ...
    }
}
```

## Parameters

- `host` (`string?`)
  The host to check.

## Returns

`bool` -- `true` if the host is "localhost" (case-insensitive); otherwise, `false`.

## IsLocalhost(Uri?)

- Name: `IsLocalhost(Uri?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L34)

Determines whether the specified URI uses a host that is "localhost".

```csharp
public static class EndpointHostHelpers
{
    public static bool IsLocalhost(
        Uri? uri)
    {
        // ...
    }
}
```

## Parameters

- `uri` (`Uri?`)
  The URI to check.

## Returns

`bool` -- `true` if the host is "localhost" (case-insensitive); otherwise, `false`.

## IsLocalhostOrLocalhostTld(string?)

- Name: `IsLocalhostOrLocalhostTld(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L95)

Determines whether the specified host is "localhost" or uses the ".localhost" top-level domain.

```csharp
public static class EndpointHostHelpers
{
    public static bool IsLocalhostOrLocalhostTld(
        string? host)
    {
        // ...
    }
}
```

## Parameters

- `host` (`string?`)
  The host to check.

## Returns

`bool` -- `true` if the host is "localhost" (case-insensitive) or ends with ".localhost" (case-insensitive); otherwise, `false`.

## IsLocalhostOrLocalhostTld(Uri?)

- Name: `IsLocalhostOrLocalhostTld(Uri?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L108)

Determines whether the specified URI uses a host that is "localhost" or ends with ".localhost".

```csharp
public static class EndpointHostHelpers
{
    public static bool IsLocalhostOrLocalhostTld(
        Uri? uri)
    {
        // ...
    }
}
```

## Parameters

- `uri` (`Uri?`)

## Returns

`bool` -- `true` if the host is "localhost" (case-insensitive) or ends with ".localhost" (case-insensitive); otherwise, `false`.

## IsLocalhostTld(string?)

- Name: `IsLocalhostTld(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L46)

Determines whether the specified host ends with ".localhost".

```csharp
public static class EndpointHostHelpers
{
    public static bool IsLocalhostTld(
        string? host)
    {
        // ...
    }
}
```

## Parameters

- `host` (`string?`)
  The host to check.

## Returns

`bool` -- `true` if the host ends with ".localhost" (case-insensitive); otherwise, `false`.

## IsLocalhostTld(Uri?)

- Name: `IsLocalhostTld(Uri?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointHostHelpers.cs#L70)

Determines whether the specified URI uses a host that is "localhost".

```csharp
public static class EndpointHostHelpers
{
    public static bool IsLocalhostTld(
        Uri? uri)
    {
        // ...
    }
}
```

## Parameters

- `uri` (`Uri?`)
  The URI to check.

## Returns

`bool` -- `true` if the host ends with ".localhost" (case-insensitive); otherwise, `false`.
