// Module included in the following assemblies:
//
// * welcome/accessing-your-services.adoc

[id="dedicated-configuring-your-application-routes_{context}"]
= Configuring your application routes

When your cluster is provisioned, an Elastic Load Balancing (ELB) load balancer is created
to route application traffic into the cluster. The domain for your ELB is configured to route application traffic via
`http(s)://*.<cluster-id>.<shard-id>.p1.openshiftapps.com`. The `<shard-id>` is a
random four-character string assigned to your cluster at creation time.

If you want to use custom domain names for your application routes, {product-title} supports
CNAME records in your DNS configuration that point to
`elb.apps.<cluster-id>.<shard-id>.p1.openshiftapps.com`. While `elb` is recommended as a
reminder for where this record is pointing, you can use any string for this
value. You can create these CNAME records for each custom route you have, or you
can create a wildcard CNAME record. For example:

[source,text]
----
*.openshift.example.com    CNAME    elb.apps.my-example.a1b2.p1.openshiftapps.com
----

This allows you to create routes like *_app1.openshift.example.com_* and
*_app2.openshift.example.com_* without having to update your DNS every time.

////

Customers with configured VPC peering or VPN connections have the option of
requesting a second ELB, so that application routes can be configured as
internal-only or externally available. The domain for this ELB will be identical
to the first, with a different `<shard-id>` value. By default, application
routes are handled by the internal-only router. To expose an application or
service externally, you must create a new route with a specific label,
`route=external`.

To expose a new route for an existing service, apply the label `route=external`
and define a hostname that contains the secondary, public router shard ID:

----
$ oc expose service <service-name> -l route=external --name=<custom-route-name> --hostname=<custom-hostname>.<shard-id>.<cluster-id>.openshiftapps.com
----

Alternatively, you can use a custom domain:

----
$ oc expose service <service-name> -l route=external --name=<custom-route-name> --hostname=<custom-domain>
----

////
