# How to Point Your GoDaddy Apex (Root) Domain to a CloudFront Application       -               A Simple Workaround! 💡

Have you ever faced the issue where your application works perfectly with `www.example.com` but fails to load when you try `example.com`? If you’re using GoDaddy and CloudFront, you might have encountered this problem. By default, GoDaddy doesn’t allow you to point a CNAME record to an APEX (root) domain like `example.com`. But don’t worry – there’s a workaround! In this blog, I’ll Walk you through the steps I took to solve this issue and get my application up and running for both `www.example.com` and `example.com`.

---

# **My Scenario: 😵‍💫**

When I deployed my application using AWS CloudFront, I could only point my domain to `www.example.com`. Whenever I tried to access `example.com` (the root domain), I got Error from GoDaddy. This is because GoDaddy doesn’t support CNAME records for APEX (root) domains by default. CNAME records are typically used for subdomains like `www`, but not for the root domain.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738219195188/dc55659d-f147-485e-8270-481dbc2846f9.png align="center")

---

# **The Solution: Using GoDaddy’s Forwarding Option💡**

After some research and trial and error, I found a simple workaround using GoDaddy’s forwarding feature. Here’s how I did it:

1. **Log in to Your GoDaddy Account:** Go to your GoDaddy dashboard and navigate to the domain you want to configure.
    
2. **Set Up a Forward:**
    
    * Go to the **Forwarding** section.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738219458549/0b5c95bd-8efa-4cc0-b670-c0fef9291882.png align="left")
        
    * Select the root domain (`example.com`) and set it to forward to `www.example.com`.
        
    * Choose the **Permanent (301)** forward option.
        
    * Then click &gt; **Save**.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738220109387/c9cb3d6e-78d4-4afd-b059-81a11af2cc01.png align="center")
        
3. **Save the Changes:** Once you’ve configured the forward, save the changes. It might take a few minutes for the changes to propagate.
    

---

# **Why This Works: ⚒️✅**

By setting up a forward, you’re essentially telling GoDaddy to forward all traffic from `example.com` to `www.example.com`. Since `www.example.com` is a subdomain, you can easily point it to your CloudFront distribution using a CNAME record. This way, users accessing `example.com` will be seamlessly forwarded to `www.example.com`, where your application is hosted.

---

# **Steps to Point** `www.example.com` to CloudFront: 🧱🔨

1. **Go to DNS Management:** In your GoDaddy account, navigate to the DNS management section for your domain.
    
2. **Add a CNAME Record:**
    
    * Create a new CNAME record for `www`.
        
    * Point it to your CloudFront distribution’s domain name (e.g., `d1234.cloudfront.net`).
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738220901560/90d361a5-86ce-4d97-8f8f-441d3c8cbf6f.png align="center")
        
3. **Save the Changes:** Save the DNS changes and wait for them to propagate (this can take up to 48 hours, but it’s usually faster).
    

---

# **Conclusion: 🎃**

While GoDaddy doesn’t allow CNAME records for APEX (root) domains, this simple forward workaround ensures that your users can access your application using both `example.com` and `www.example.com`. By following these steps, I was able to solve the issue and make my application accessible from both URLs.  
  
I hope this guide helps you too! ❤️

---

# **Pro Tip: 🚀**

📌If you’re looking for a more advanced solution, consider using **AWS Route 53** for DNS management. Route 53 **supports ALIAS records**, which allow you to point your root domain directly to CloudFront without the need of forwarding option.

📌Alternatively, if you don’t want to use AWS, you can use **Cloudflare**. Cloudflare allows you to create CNAME-like records for root domains (using their **CNAME flattening feature**), making it easy to point `example.com` directly to your CloudFront endpoint. Plus, Cloudflare offers additional benefits like improved performance, security, and DDoS protection.

---

📬Let me know in the comments if this solution worked for you! and 🔗share this guide with others who might find it helpful!

#cloudfront #aws #getintokube #getintokubeblogs
