> **Documentation Update:** Product documentation previously located in `/website` has moved to the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository, where all product documentation is now centralized. Please make contributions directly to `web-unified-docs`, since changes to `/website` in this repository will not appear on developer.hashicorp.com.
An alias is a globally unique, DNS-like string that is associated with a destination resource. You can establish a session to a target by referencing its alias, instead of having to provide a target ID or target name and scope ID.
For more information about aliases, including naming conventions and best practices, refer to [Overview of aliases](/boundary/docs/targets/configuration).
You can create aliases and associate them with targets using the following methods:
- [Create an alias for an existing target](#create-an-alias-for-an-existing-target)
- [Create an alias during target creation](#create-an-alias-during-target-creation)
- [Associate an existing alias with a target](#associate-an-existing-alias-with-a-target)
- [Create multiple target aliases: An example](#create-multiple-aliases-for-a-single-target)
## Create an alias for an existing target
You can create a new alias and associate it with an existing target at the same time.
When you create the target alias, you can choose from the following methods:
- Create the alias without adding a target
- Create the alias for one or more targets
- Create the alias with an optional host ID
Complete the following steps to create a new alias and associate it with a target:
<Tabs>
<Tab heading="UI" group="ui">
1. Log in to Boundary.
1. Select **Aliases** in the navigation pane.
1. Click **New Alias**.
1. Complete the following fields:
- **Name**: (Optional) Enter an optional name for the alias to use for identification purposes.
- **Description**: (Optional) Enter an optional description for the alias to use for identification purposes.
- **Type**: Select **Target**.
At this time, targets are the only Boundary resources that supports aliasing.
- **Alias Value**: Enter the string that you want to use as the alias to represent the target.
An alias's value can be a hostname or a DNS-like string.
- **Target ID**: (Optional) Specify any targets you want to associate with the alias.
- **Host ID**: (Optional) Enter an optional host ID, if you would like to specify that the alias always uses the same host when you use it to connect to a target.
1. Click **Save**.
</Tab>
<Tab heading="CLI" group="cli">
1. Log in to Boundary.
1. Use the following command to create an alias:
```shell-session
$ boundary aliases create target \
-description 'This is an example alias for target tcp_1234567890' \
Alternatively, you can configure host catalogs and host sets.
If you set a target address for RDP targets that use Kerberos authentication, use the target's hostname and append the domain to it, for example `target-hostname.mydomain.com`. For RDP targets that use NTLM authentication, set the target address to the target's IP address.
If you set a target address for RDP targets that use Kerberos authentication, use the target's hostname and append the domain to it, for example `target-hostname.mydomain.com`. For RDP targets that use NTLM authentication, set the target address to the target's IP address.
If you [created an alias](#create-an-alias-for-an-existing-target) without associating it with a target, you can update it with an existing target at a later time. Complete the following steps to add an alias to a target:
<Tabs>
<Tab heading="UI" group="ui">
1. Log in to Boundary.
1. Select **Targets** in the navigation pane.
1. Select the target you want to add an alias to.
1. Under the **Aliases** heading in the right sidebar, click **Add an alias**.
1. Complete the following fields:
- **Name**: (Optional) Enter an optional name for the alias to use for identification purposes.
- **Description**: (Optional) Enter an optional description for the alias to use for identification purposes.
- **Type**: Select **Target**.
At this time, targets are the only Boundary resources that supports aliasing.
- **Alias Value**: Enter the alias value you want to use in commands to represent the target.
An alias's value can be a hostname or a DNS-like string.
- **Target ID**: This field contains the ID of the target you selected to add an alias to.
It is read only.
- **Host ID**: (Optional) Enter an optional host ID, if you would like to specify that the alias always uses the same host when you use it to connect to a target.
If you created a `boundary_alias_target` resource without setting a `destination_id` attribute, update the `destination_id` and reapply the following policy:
[Host sets](/boundary/docs/domain-model/host-sets) are sets of functionally equivalent hosts, and are commonly used for deployments at scale. When Boundary authorizes a session, a target assigned a host set will select a host from the host set at random to use for all connections for the session.
You assign [direct target addresses](/boundary/docs/domain-model/targets#address) directly to the target. They refer to a specific network resource, like an IP address. Boundary only connects to the direct target address when it establishes a connection to the associated target.
If you set a target address for RDP targets that use Kerberos authentication, use the target's hostname and append the domain to it, for example `target-hostname.mydomain.com`. For RDP targets that use NTLM authentication, set the target address to the target's IP address.
When you create a target alias, you can also assign it to a specific host. Assigning an alias to a specific host is useful if you want to avoid creating multiple targets for specific hosts using direct target addresses.
For example, you could create two aliases for the same target that has been assigned a host set. One alias could refer to the target itself, and would allow Boundary to randomly select a host to connect to for a session. Another alias could point to the same target, but you could assign a host ID that Boundary should use for a session.
### Example
You may want to create aliases that point to the same target, but that specify which host Boundary should use when it establishes a session.
In this example, you set up three aliases for the same target:
1. A target alias without a host specified
1. A target alias with a host ID specified
1. A target alias with a different host ID specified
<Note>
This example uses SSH target types, which are only available in HCP Boundary and Boundary Enterprise. This process also works for any other target type, including the TCP target type available in Boundary Community Edition.
</Note>
For this example, assume that the following scopes exist:
- Org: `engineering`, ID `o_2drCWvp3Oc`
- Project: `app-servers`, ID `p_3ECODJDbXV`
And the following host set and hosts exist:
- Host set: `linux-dev-servers`, ID `hsst_56oiL0WaKu`
Because the `linux-dev-servers` hosts are functionally equivalent, you can create a single target for the host set, and create an alias for the target.
In the following examples, Terraform resources are named with underscores instead of dashes, such as `linux_dev_servers`. The target alias values use dashes, such as `dev-041.linux-dev.app-servers.eng`. You do not need to follow these naming conventions.
Create the `linux_dev_servers` SSH target, with `scope_id` set to `app_servers` and the host source `linux_dev_servers` (these resources are not shown):