Add a Domain
Now that you have a complete application stack running (web app, database, and cache), it's time to make your application accessible through your own custom domain. Instead of using the default *.viduli.app
subdomain, you'll configure your application to be accessible through a professional domain like acme.com
.
In this tutorial, you'll add a custom domain to your project and configure DNS settings to route traffic through your branded URL. You'll see how Viduli automatically handles SSL certificate provisioning and traffic routing to ensure your application is accessible securely through your custom domain. For detailed information about domain management, see the complete Projects documentation.
Prerequisites
Before adding a custom domain, ensure you have:
- A complete Viduli application stack: Complete the Deploy a Cache tutorial first
- Domain ownership: You must own or have administrative access to the domain you want to add
- DNS management access: Ability to modify DNS records for your domain
- Basic DNS knowledge: Understanding of CNAME and ALIAS records
Domain Overview
Custom domains provide several important benefits for your application:
- Professional branding: Users see your company domain instead of a generic subdomain
- Trust and credibility: Custom domains appear more trustworthy to users
- SEO benefits: Search engines prefer branded domains over subdomains
- Marketing advantage: Easier to remember and share branded URLs
- SSL certificates: Automatically provisioned and managed by Viduli
Your custom domain will be automatically configured with SSL/TLS encryption, CDN acceleration, and integrated with your project's API gateway for seamless traffic routing.
Step-by-Step Instructions
1. Access Your Project
Navigate to your project by clicking on the project name in the sidebar. You should see your complete application stack (FastAPI app, PostgreSQL database, and Redis cache) deployed on the canvas.
2. Open Project Settings
To access domain configuration:
- Hover over your project name in the sidebar
- Click the options menu icon (
...
) that appears - Select
Settings
from the dropdown menu
This opens the project settings dialog with multiple configuration tabs.
3. Navigate to Domains Tab
In the project settings dialog:
- Click the
Domains
tab at the top of the dialog - Review the default domain already configured (e.g.,
organization-team-project.viduli.app
)
The Domains tab shows all domains associated with your project, including the automatically provisioned Viduli subdomain.
4. Add Your Custom Domain
To add your custom domain:
- Enter your domain name in the text box (e.g.,
acme.com
) - Click the
Add
button to initiate the domain addition process - Observe the status - the domain will show as
pending
while awaiting DNS verification
Domain Format: Enter just the domain name without http://
or https://
prefixes. For example, use acme.com
or www.acme.com
, not https://acme.com
.
5. Configure DNS Records
After adding the domain, you need to configure your DNS provider to route traffic to Viduli. You have two options:
Option A: CNAME Record (Recommended)
For subdomains like www.acme.com
or api.acme.com
:
- Log into your DNS provider (e.g., Cloudflare, Route 53, GoDaddy)
- Navigate to DNS management for your domain
- Create a new CNAME record:
- Name/Host:
www
(or your desired subdomain) - Value/Target:
cname.viduli.app
- TTL: 300 seconds (5 minutes) or Auto
- Name/Host:
Option B: ALIAS Record (Root Domain)
For root domains like acme.com
(if your DNS provider supports ALIAS records):
- Log into your DNS provider
- Navigate to DNS management for your domain
- Create a new ALIAS record:
- Name/Host:
@
or leave blank (represents root domain) - Value/Target:
cname.viduli.app
- TTL: 300 seconds (5 minutes) or Auto
- Name/Host:
DNS Provider Compatibility: Not all DNS providers support ALIAS records for root domains. If ALIAS is not available, consider using www.acme.com
instead of acme.com
, or check if your provider offers similar functionality under different names (like ANAME or CNAME flattening).
6. Wait for DNS Verification
After configuring your DNS records:
- Stay on the Domains tab in your project settings
- Monitor the domain status - it will change from
pending
toverified
once DNS propagation completes - Wait for completion - verification typically takes 5-15 minutes but can take up to 24 hours
During this process, Viduli automatically:
- Verifies domain ownership through DNS
- Provisions SSL/TLS certificates
- Configures CDN and routing rules
- Tests connectivity and security
7. Test Domain Connectivity
Once your domain shows verified
status, test the connection:
# Test your custom domain
curl https://acme.com/api/articles
# Compare with the default domain
curl https://organization-team-project.viduli.app/api/articles
# Both should return the same response
Expected Result: Both URLs should return identical responses, confirming that your custom domain is properly routing traffic to your application.
DNS Propagation and Troubleshooting
Understanding DNS Propagation
DNS changes don't take effect immediately worldwide. Propagation involves:
- Local DNS cache: Your computer may cache old DNS records
- ISP DNS servers: Internet service providers cache DNS records
- Global DNS network: Changes spread gradually across DNS servers worldwide
Troubleshooting Common Issues
Domain Stuck in Pending Status
If your domain remains pending
for more than an hour:
- Verify DNS records: Double-check CNAME/ALIAS configuration
- Check DNS propagation: Use tools like
dig
or online DNS checkers - Clear DNS cache: Restart your router or flush local DNS cache
- Contact support: If issues persist beyond 24 hours
What You've Accomplished
Congratulations! You've successfully configured a custom domain for your application. Your domain now provides:
- Professional Branding: Your application is accessible through your own domain
- Automatic SSL/TLS: Secure HTTPS connections with automatically managed certificates
- Global CDN: Fast content delivery worldwide through Viduli's CDN network
- Integrated Routing: Seamless integration with your project's API gateway
- High Availability: Built-in redundancy and failover capabilities
Next Steps
Now that your application has a custom domain, you can:
- Configure Additional Domains: Add subdomains for different environments or services
- Implement Analytics: Track user behavior and application performance
- Plan Scaling: Prepare for increased traffic through your branded domain
- Marketing Launch: Promote your application with its professional domain
Your application is now ready for production use with a complete, professional web presence accessible through your own branded domain!