# Binding a service to multiple hosts

**URL:** <https://openziti.discourse.group/t/binding-a-service-to-multiple-hosts/1053>\
**Category:** Ziti Tunnel\
**Created:** [February 6, 2023, 4:05am UTC](https://openziti.discourse.group/t/binding-a-service-to-multiple-hosts/1053 "2023-02-06T04:05:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![scareything](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/scareything/32/106_2.png) [@scareything](https://openziti.discourse.group/u/scareything)\
**Post date:** [February 7, 2023, 9:58pm UTC](https://openziti.discourse.group/t/binding-a-service-to-multiple-hosts/1053/3 "2023-02-07T21:58:14Z")

</div>

I think addressable terminators can help with this case. Basically you set `dialOptions.identity` in the intercept configuration to tell the dialing tunneler which terminator to dial. Here’s an example from an ssh service that I use:

```json
    ziti edge create config ssh-intercept.v1 intercept.v1 '{
      "protocols": ["tcp"],
      "addresses": ["zet.shawns-m1-mbp","zde.shawns-m1-mbp","zet.fedora-37-vm"],
      "portRanges": [{"low":22,"high":22}],
      "dialOptions": {
        "identity": "$dst_hostname"
      }
    }'

```

And you also need to tell the hosting tunnelers what their terminator name is. You can do this with `listenOptions.identity` or `listenOptions.bindUsingEdgeIdentity`. Here’s the remainder of my ssh example. This assumes that the identities are named _exactly_ the same as the hostnames that they are addressed by:

```auto
ziti edge create config ssh-host.v1 host.v1 '{
      "protocol": "tcp",
      "address": "127.0.0.1",
      "port": 22,
      "listenOptions": {
        "bindUsingEdgeIdentity": true
      }
    }'

```

At this time the following variables are supported in `dialOptions.identity`:

- `$dst_protocol`
- `$dst_ip`
- `$dst_port`
- `$dst_hostname`

See [support domain substitutions · Issue #540 · openziti/ziti-tunnel-sdk-c · GitHub](https://github.com/openziti/ziti-tunnel-sdk-c/issues/540) for some ideas that might be implemented in the future, and of course feel free to comment on the issue with any thoughts.

`listenOptions.identity` currently only supports `$tunneler_id.name`, which is effectively the same as setting `bindUsingEdgeIdentity` to true.

---

_[View the full topic](https://openziti.discourse.group/t/binding-a-service-to-multiple-hosts/1053)._
