Container Name Service (CNS)

Modified: 03 Jan 2024 23:26 UTC

Triton Container Name Service (CNS) is a completely automatic, universal DNS for your containers and VMs on Triton. It is tightly integrated with Triton to eliminate complexity and simplify operations.

Triton CNS serves address records (both A and AAAA) for containers by instance name and tags. Multiple containers providing the same service can share the same tag and will be returned in the same address record. Because Triton CNS knows when containers are started or stopped, including unexpected stops, the DNS information is automatically updated and requests will be sent to running containers.

See what Triton CNS does below, and examples for using it via Docker, and with the Triton CLI/CloudAPI.

What does Triton CNS do?

Triton CNS is designed to do two things very well:

  1. Serve address records for instances by instance name (each instance gets a DNS name that just refers only to that container)
  2. Serve address records for instances grouped by service label/tag (multiple instances are listed in one DNS name, depending on their availability)

When activated for an account, running instances in Triton Compute Service with public network interfaces will be available in DNS using the following FQDN patterns:

<instance name>.inst.<account uuid>.<data center name>.triton.zone
<service name>.svc.<account uuid>.<data center name>.triton.zone

When activated for an account, running instances in Triton Compute Service with private network interfaces will be available in DNS and accessible inside the data center using the following FQDN patterns:

<instance name>.inst.<account uuid>.<data center name>.cns.mnx.io
<service name>.svc.<account uuid>.<data center name>.cns.mnx.io

The FQDN base (triton.zone and cns.mnx.io in the examples above) is fully configurable when running Triton CNS in private clouds.

All the DNS names for an instance can be found in the instance details in CloudAPI, easily accessed using the triton instance get <instance name> command.

What is Triton CNS not designed for?

Triton CNS is not a general purpose DNS solution, and, while it is very convenient way to interconnect application components inside a data center, there are caveats that developers and operators should be aware of.

Triton CNS can be used in conjunction with a general purpose DNS provider to provide name services using your own domain name, but cannot be directly configured by users to serve custom domain names (note that data center operators can configure their own domain names in Triton CNS).

What should I use it for?

Triton Container Name Service is ideal for making applications discoverable on the internet, and, in narrow circumstances, supporting discovery between application components inside the data center. For many use-cases, it is a convenient and free alternative to load balancers, hosted proxies, and virtual IP addresses.

Commands and usage

FAQ