Articles on: Meteor Apps

DNS

Setting up DNS records correctly is crucial for making your Galaxy application accessible to users worldwide. This guide will walk you through various DNS configuration methods, helping you choose the best approach for your specific hosting needs.


Galaxy Cloud operates in multiple regions globally, and while we handle the infrastructure, you'll need to configure your DNS provider to point to our services. Don't worry if you're new to DNS configuration. We'll guide you through each step and provide clear examples along the way.


Understanding Your DNS Options


Before diving into configuration, it's important to understand that Galaxy Cloud offers flexible DNS setup options to accommodate different hosting preferences and technical requirements. Whether you prefer using a subdomain, need to host on a root domain, or want to leverage our free subdomain service, we have a solution that fits your needs.


Free Subdomain Service


If you don't have a custom domain or prefer to get started quickly, Galaxy Cloud provides free subdomains based on your deployment region:



These subdomains come with SSL enabled by default and require no DNS configuration on your part. Galaxy handles everything automatically. Simply deploy your application using the provided subdomain format, and you're ready to go.



For most applications, we recommend using a subdomain approach with CNAME records. This method provides the most reliable DNS resolution and is supported by virtually all DNS providers.


Step-by-Step Configuration


  1. Choose Your Subdomain Structure


  1. Create the CNAME Record

Add a CNAME record to your DNS provider pointing to the appropriate Galaxy ingress endpoint for your region:


  1. Verify Your Configuration

After DNS propagation (typically 30 minutes to 2 hours), test your configuration using the command:

   dig www.yourcompany.com

You should see a CNAME record pointing to the Galaxy ingress endpoint.


SSL Certificate Management


Galaxy automatically attempts to provision a Let's Encrypt SSL certificate for new deployments. This process includes:


  • Automatic certificate generation for your domain
  • HTTPS redirection enforcement
  • Periodic certificate renewal


You can also upload your own SSL certificates if you prefer using a commercial certificate authority or have specific compliance requirements.


Method 2: Root Domain Hosting with A Records


If your DNS provider doesn't support ALIAS, ANAME records, or CNAME flattening, you can use A records to point directly to IP addresses. This method is particularly useful when you need to host on a root domain but have DNS provider limitations.


Configuration Process


  1. Access Your Galaxy Dashboard

Navigate to the "Domains & HTTPS" section of your Galaxy application dashboard


  1. Locate Your Dedicated IP

Galaxy provides a dedicated IP address for your application, which you'll find displayed in the domains section


  1. Create the A Record

Add an A record in your DNS provider pointing your root domain to the IP address shown in your Galaxy dashboard


  1. Add the Domain in Galaxy

After DNS propagation, return to your Galaxy dashboard and click "Add New Domain" to register your root domain with the platform


  1. Enable HTTPS

Once the domain is added, click "Generate Certificate" to activate HTTPS and optionally enable automatic HTTP to HTTPS redirection


This approach ensures your application remains accessible even with DNS providers that have limited record type support.


Method 3: Root Domain Hosting with ALIAS Records


For DNS providers that support ALIAS (or ANAME) records, you can achieve clean root domain hosting without the complexity of managing IP addresses directly.


Implementation Steps


  1. Deploy or Configure Your App

Ensure your Galaxy application is deployed to your root domain (e.g., yourcompany.com) or add the root domain as an additional domain in your app settings


  1. Create the ALIAS Record

Set up an ALIAS record in your DNS provider pointing your root domain to galaxy-ingress.meteor.com


  1. Configure WWW Redirection

Since you're hosting on the root domain, consider setting up URL redirection to forward www.yourcompany.com to your root domain for consistency


DNS Provider Compatibility


Not all DNS providers support ALIAS records, and implementation varies significantly between providers. We recommend these providers known for robust ALIAS support:


  • DNSimple: Offers comprehensive ALIAS record functionality
  • AWS Route 53: Provides ALIAS records with excellent AWS integration
  • Cloudflare: Supports CNAME flattening which functions similarly to ALIAS


Method 4: AWS Route 53 Complete Setup


If you're using AWS as your cloud provider or prefer a comprehensive AWS-based DNS solution, this method provides detailed steps for configuring all necessary AWS services. This approach is particularly useful if you need advanced features like geographic routing, health checks, or integration with other AWS services.


Prerequisites


Before starting, ensure you have:

  • An active AWS account (you can create one at AWS Portal)
  • Access to the AWS Console
  • Your domain purchased from any domain registrar


Step 1: Configure AWS Route 53 as Your DNS Provider


First, you'll set up Route 53 to manage your domain's DNS records:


  1. Create a Public Hosted Zone
  • Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/
  • In the navigation pane, choose "Hosted zones"
  • Choose "Create hosted zone"
  • For "Domain name," enter your domain name (e.g., mycompany.com)
  • Keep "Type" as "Public hosted zone"
  • Choose "Create hosted zone"


  1. Update Your Domain's Name Servers
  • After creating the hosted zone, note the four name server (NS) records that were created (each will start with "ns-")
  • The values will look similar to:
     ns-1623.awsdns-10.co.uk.
ns-492.awsdns-61.com.
ns-709.awsdns-24.net.
ns-1485.awsdns-57.org.
  • At your domain registrar, replace the existing name servers with the AWS Route 53 name servers
  • DNS changes may take up to 48 hours to propagate globally


  1. Configure Your Subdomain for Galaxy
  • In your Route 53 hosted zone, create a CNAME record for your subdomain (e.g., www.mycompany.com or app.mycompany.com)
  • Point it to the appropriate Galaxy ingress endpoint for your region
  • Wait for DNS propagation (typically 30 minutes to 2 hours)


Step 2: Set Up Root Domain Redirection with AWS S3


If you want your root domain to redirect to your Galaxy-hosted subdomain:


  1. Create an S3 Bucket for Redirection
  • Open the Amazon S3 console at https://console.aws.amazon.com/s3/
  • Choose "Create bucket"
  • For "Bucket name," enter your root domain exactly (e.g., mycompany.com)
  • Choose an AWS Region (preferably close to your users)
  • Under "Block Public Access settings," uncheck "Block all public access"
  • Check "I acknowledge that the current settings might result in this bucket and the objects within becoming public"
  • Choose "Create bucket"


  1. Configure Static Website Hosting for Redirection
  • Select your newly created bucket
  • Choose the "Properties" tab
  • Scroll down to "Static website hosting" and choose "Edit"
  • Select "Enable"
  • Under "Hosting type," select "Redirect requests for an object"
  • For "Host name," enter your subdomain (e.g., www.mycompany.com)
  • For "Protocol," select "https"
  • Choose "Save changes"
  • Copy the "Bucket website endpoint" URL (it will look like http://mycompany.com.s3-website-region.amazonaws.com) for use in the CloudFront setup


Step 3: Create SSL Certificate with AWS Certificate Manager


To secure your root domain with HTTPS:


  1. Request a Public Certificate


  1. Complete DNS Validation
  • Select your certificate from the list (status will show "Pending validation")
  • In the "Domains" section, you'll see validation records needed
  • If using Route 53, choose "Create records in Route 53" button
  • AWS will automatically add the necessary CNAME validation records to your hosted zone
  • Wait for validation (typically 5-30 minutes, but can take up to several hours)
  • Refresh the certificate list until the status shows "Issued"


Step 4: Configure AWS CloudFront Distribution


CloudFront will provide the HTTPS endpoint and global content delivery for your root domain:


  1. Create CloudFront Distribution
  • Open the CloudFront console at https://console.aws.amazon.com/cloudfront/
  • Choose "Create distribution"
  • For "Origin domain," enter your S3 bucket website endpoint (from Step 2, without the http:// prefix)
  • Leave "Origin path" empty
  • For "Name," enter a descriptive name for your distribution


  1. Configure Default Cache Behavior
  • Under "Default cache behavior"
  • For "Viewer protocol policy," select "Redirect HTTP to HTTPS"
  • For "Allowed HTTP methods," choose "GET, HEAD, OPTIONS" (sufficient for redirects)
  • For "Cache key and origin requests," select "Legacy cache settings"
  • Leave other settings as default


  1. Configure Distribution Settings
  • Under "Settings"
  • For "Alternate domain name (CNAME)," add both:
  • For "Custom SSL certificate," select the certificate you created in Step 3
  • Leave other settings as default
  • Choose "Create distribution"
  • Wait for deployment (typically 15-20 minutes until status shows "Enabled")


Step 5: Create the Final A Record in Route 53


Connect your root domain to the CloudFront distribution:


  1. Create Alias A Record
  • Return to the Route 53 console at https://console.aws.amazon.com/route53/
  • Open your hosted zone
  • Choose "Create record"
  • Leave "Record name" empty (this creates a record for the root domain)
  • For "Record type," select "A – Routes traffic to an IPv4 address and some AWS resources"
  • Turn on "Alias"
  • For "Route traffic to," select "Alias to CloudFront distribution"
  • Select your CloudFront distribution from the dropdown
  • Choose "Create records"


Verification and Testing


After completing these steps and allowing for DNS propagation:


  1. Test DNS Resolution
   # Check your root domain points to CloudFront
dig mycompany.com

# Check your subdomain points to Galaxy
dig www.mycompany.com


  1. Verify HTTPS Redirection


  1. Check Certificate Validity
  • Verify the SSL certificate is valid and trusted in your browser
  • Ensure there are no mixed content warnings on your Galaxy application


Important Considerations


  • DNS Propagation: Changes to Route 53 records typically propagate within minutes, but can take up to 48 hours globally
  • Certificate Validation: DNS validation is faster than email validation when using Route 53, but still requires patience
  • CloudFront Deployment: Distribution deployment takes 15-20 minutes and must complete before testing
  • Costs: This setup incurs charges for Route 53 hosted zones, CloudFront requests, and certificate renewal (Let's Encrypt certificates through ACM are free)


This comprehensive AWS setup provides enterprise-grade DNS management with advanced features and seamless integration with other AWS services. While more complex than our simpler DNS methods, it offers maximum flexibility and control for organizations already invested in the AWS ecosystem or requiring advanced DNS capabilities.


Troubleshooting and Best Practices


DNS Propagation Timeline


DNS changes don't take effect immediately due to the distributed nature of the internet's DNS system:


  • Typical propagation time: 30 minutes to 2 hours
  • Maximum propagation time: Up to 24-48 hours in rare cases
  • Factors affecting speed: Record TTL values, geographic location, local DNS caching


Verification Commands


Use these terminal commands to verify your DNS configuration:


# Check CNAME records
dig www.yourcompany.com

# Check A records
dig yourcompany.com

# Check from specific DNS servers
dig @8.8.8.8 yourcompany.com


Common Configuration Issues


CNAME Record Not Resolving

  • Verify the target hostname is exactly as specified for your region
  • Ensure there are no trailing spaces in your DNS configuration
  • Check that you're not mixing CNAME and A records for the same hostname


SSL Certificate Problems

  • Allow 5-10 minutes for initial certificate generation
  • Ensure your domain is properly added in the Galaxy dashboard
  • Verify DNS is pointing correctly before requesting certificates


Root Domain Complications

  • Remember that CNAME records cannot be used at the root level
  • Consider whether you actually need root domain hosting or if a subdomain would suffice
  • Plan for www vs non-www consistency in your user experience


Getting Additional Support


DNS configuration can sometimes present unique challenges based on your specific setup and requirements.


Remember that DNS changes are often cached at multiple levels, so patience during troubleshooting is important. When reporting issues to support, include details about your DNS provider, the exact records you've configured, and any error messages you're seeing.


The Galaxy team is committed to helping you achieve a smooth, professional deployment. Don't hesitate to reach out if you need guidance tailored to your specific use case or technical environment.

Updated on: 02/07/2025