Setting Up DNS for Your Environment

Page last updated:

This topic describes how to set up DNS for your Cloud Foundry environment.

Domains

Your must create several wildcard DNS records to point to your load balancer(s) or router(s). Consult the following table.

Domain Example Notes
TCP *.tcp.example.com This handles TCP traffic destined for the TCP Router.
HTTP *.sys.example.com This is the system domain that handles HTTP traffic for system components destined for the GoRouter.
HTTP *.example.com This is the app domain that handles HTTP traffic for applications destined for the GoRouter.
WebSockets *.ws.example.com This is an optional domain that handles WebSocket traffic destined for the GoRouter.
SSH *.ssh.example.com This is an optional domain that provides SSH access to application containers.

Note: Cloud Foundry gives each application its own hostname in your app domain. With a wildcard DNS record, every hostname in your domain resolves to the IP address of your router or load balancer, and you do not need to configure an A record for each app hostname. For example, if you create a DNS record for a system domain *.example.com pointing to your router, every application deployed to the example.com domain resolves to the IP address of your router.

Example Topologies

Your exact configuration will vary significantly depending on your IaaS and your load balancing configuration. Below are two example topologies: the first is an Amazon Web Services (AWS) deployment using Elastic Load Balancer (ELBs), and the second uses HAProxy for load balancing.

AWS

This topology has DNS configured to point five domains to four ELBs:

Aws dns prereq

HAProxy

This topology has DNS configured to point five domains to one HAProxy:

Haproxy dns prereq

Create a pull request or raise an issue on the source for this page in GitHub