Configuring DNS & IP Addresses
Cloud 66 hostnames
Cloud 66 creates unique DNS hostnames for each server you deploy with us. All servers are accessible via their Cloud 66 DNS name which follows the following pattern:
[server_name].[app_name].[environment].c66.me
.
These use animal names to make them more easily recognizable. For example:
Load Balancers also get a name from Cloud 66 DNS. The load balancer names look like [app_name].[environment].c66.me
. For example, the DNS could look like: myapp.test.c66.me
. Production applications don't have the environment in their names, for example myapp.c66.me
.
This allows you to change the servers (and therefore IP addresses) for your application without needing to change any public DNS entries. You will need to manage the DNS records of your domain name to ensure that it's pointing to Cloud 66.
Browsing your app via Cloud 66 DNS
You can browse your application directly by visiting the Cloud 66 address for the primary web server. To do this:
- Log into your Dashboard
- Open your application
- Click on the Visit Site link (next to the app's name)
Finding your Cloud 66 hostnames
To find the Cloud 66 hostname for any server:
- Open your Dashboard and click on the application
- Click Application in the left-hand nav
- Click on Servers in the sub nav
- Click the name of a server. This page displays your server's Primary address (hostname) as well as the Secondary address (IP address).
Some cloud providers automatically assign a new IP address to restarted servers.
Failover hostnames
In addition to unique hostnames per server, Cloud 66 also offers Failover Groups - managed, quick-response DNS addresses that automatically follow the web endpoints of applications.
Each Failover Group has a unique hostname with a 9 digit prefix (subdomain). For example 958-797-516.cloud66.net
. For maximum reliability, you should point your DNS at a Failover Group address.
Configuring your DNS
There are three approaches to configuring your DNS - in the following recommended order:
1. Use an Alias or Aname
Some DNS hosts provide a CNAME-like functionality at the zone apex (root domain) using a custom record type.
The setup is similar for each provider - simply point the ALIAS or CNAME for your root domain to the Cloud 66 hostname for your application.
2. Use an A record with a load balancer
This involves using an A
record to point your root domain at your load balancer and then redirecting traffic to www in Nginx.
- Create a CNAME record for
www
pointing at the Cloud 66 hostname of your load balancer. - Create an
A
record for your root domain (e.g.example.com
) pointing at your load balancer IP address. - Use network redirects to permanently redirect all traffic from
example.com
towww.example.com
.
3. Subdomain redirection
This method will not work if you are serving content with SSL, and only works for HTTP traffic (i.e. not TCP or UDP).
This method creates a 301 permanent redirect to a specified subdomain for all root domain traffic.
- Create a DNS forward of
example.com
towww.example.com
. - Create a CNAME record with value
www
to the Cloud 66 hostname.
Best practices for DNS
Where possible, you should avoid using a DNS A-record (which points directly at an IP address). Instead, you should use CNAME
records to point your domain at a Cloud 66 hostname (either your server or failover group hostname).
However, this may not be possible with your DNS provider. While CNAME records do not require hard-coded IP addresses, they are often not available to root domains (e.g. example.com
). In other words, you may not be able to set a CNAME record pointing example.com to a Cloud 66 hostname. See option 2 above for a solution to this issue.
To use wildcard subdomains with Cloud 66 hostnames, simply create a CNAME record pointing *. .com
to your Cloud 66 hostname.
Cloud 66 Agent
Cloud 66 automatically detects the internal and external IP addresses of your servers through an agent installed on each server. This agent sends information about your server back to us at a 5 minute interval, which is used to auto-generate the WEB_ADDRESS_INT
and WEB_ADDRESS_EXT
environment variables (among others) when necessary.
To allow users the flexibility of choosing which one to use in their application, we also provide a WEB_ADDRESS environment variable, which by default is set to {{WEB_ADDRESS_INT}}
but can be modified by the user.
New IP addresses
If the agent fails to send us information for 20 minutes, the server owner is notified by email. Should the server IP address subsequently change, we are notified by the agent, which in turn updates the environment variables affected.
If the new IP address is reachable, Cloud 66 ensures that firewall rules are reconstructed, ActiveProtect is reconfigured and DNS records are updated accordingly.
Furthermore, if required, the load balancer is updated to serve the new IP address. Once this process is complete, the server owner receives a notification of success by email and will be encouraged to redeploy the application.
What’s next?
- Learn how to set up a Failover Group
- Learn how to configure network access to your application
- Learn how to add a load balancer to your application