Container DNS Hostnames
DNS Hostnames for Direct Connection to Containers
Hostnames for Specific Containers
Each container can be addressed through its internal IP using either of the following hostname formats:
node${nodeId}-${envName}.${platformDomain}
node${nodeId}.${envName}.${platformDomain}
${nodeId}Automatically generated numeric identifier assigned to the container.${envName}Environment name specified during creation, not the environment alias.${platformDomain}Domain name of the hosting provider’s PaaS installation.
Supplementary Hostnames by Node Type
Some certified stacks provide an additional stack-specific hostname prefix instead of the generic node prefix.
| Node Type | Stack | Additional Hostname |
|---|---|---|
| Custom containers | Docker | docker${nodeId}-${envName}.${platformDomain} |
| Database | Cassandra | cassandra${nodeId}-${envName}.${platformDomain} |
| Database | CouchDB | couchdb${nodeId}-${envName}.${platformDomain} |
| Database | MariaDB | mariadb${nodeId}-${envName}.${platformDomain} |
| Cache | Memcached | memcached${nodeId}-${envName}.${platformDomain} |
| Database | Microsoft SQL Server | mssql${nodeId}-${envName}.${platformDomain} |
| Database | MySQL | mysql${nodeId}-${envName}.${platformDomain} |
| Database | Neo4j | neo4j${nodeId}-${envName}.${platformDomain} |
| Database | OrientDB | orientdb${nodeId}-${envName}.${platformDomain} |
| Database | PostgreSQL | postgres${nodeId}-${envName}.${platformDomain} |
| Database | Redis | redis${nodeId}-${envName}.${platformDomain} |
| VPS | Elastic VPS | vps${nodeId}-${envName}.${platformDomain} |
Hostnames for Specific Layers
All internal IP addresses of containers within one node layer can be resolved through:
${nodeGroup}.${envName}.${platformDomain}
${nodeGroup} is the role-based name of the layer, such as an application-server, load-balancer, database, or cache layer.
cp2, cp3, and cp4. Generic extra layers use names such as extra, extra2, and extra3.
A DNS lookup command can be used to retrieve all application-server addresses for an environment:
host ${nodeGroup}.${envName}.${platformDomain}
Short Hostnames within One Environment
New Docker containers and dockerised managed stacks support simplified DNS aliases within the same environment:
node${nodeId}
${nodeGroup}
node${nodeId}addresses one specific container.${nodeGroup}resolves the containers inside one layer.
These short names can be used in application code, server configuration files, SSH sessions, and commands such as ping, host, and dig.
Hostnames for Linked Containers
Container links can expose linked-node hostnames and connection details through automatically generated environment variables. Applications can use these values to communicate with linked services without hardcoding their IP addresses.
- Use the linked service alias as the logical connection name.
- Read the generated hostname, port, and address values from the container environment.
- Avoid hardcoded internal IP addresses because they are less portable than DNS aliases.
- Review the container Links settings when a linked hostname is not available.
What’s next?
- Custom Domain Name
- Environment Aliases
- Container Links
- Public IP
- SSH Access
