# ContainerNetworkAliasAnnotation

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerNetworkAliasAnnotation.cs)
- Implements: [IResourceAnnotation](/reference/api/csharp/aspire.hosting/iresourceannotation.md)

Represents an annotation for a custom network alias for a container resource.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class ContainerNetworkAliasAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Remarks

Network aliases enable DNS resolution of the container on the network by custom names. Multiple aliases can be specified for a single container by adding multiple annotations.

## Constructors

- [ContainerNetworkAliasAnnotation(string)](/reference/api/csharp/aspire.hosting/containernetworkaliasannotation/constructors.md#constructor-string) -- Creates a new instance of the [ContainerNetworkAliasAnnotation](/reference/api/csharp/aspire.hosting/containernetworkaliasannotation.md) class with the specified alias.

## Properties

- [Alias](/reference/api/csharp/aspire.hosting/containernetworkaliasannotation/properties.md#alias) : `string` `get` -- Gets the network alias for the container.
- [Network](/reference/api/csharp/aspire.hosting/containernetworkaliasannotation/properties.md#network) : [NetworkIdentifier](/reference/api/csharp/aspire.hosting/networkidentifier.md) `get; set` -- Gets or sets the network identifier for the network to which the alias applies.
