By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!I've been trying to add a custom surge domain name and can't figure out how to not get error messages. Does anyone have experience of adding a site to surge?
Thanks,
Eliot
surge
surge --domain your-custom-domain.com
45.55.110.124
na-west1.surge.sh
surge whoami
OK, it says command not found. Do I do this in the code file or do I do it just on Terminal? Sorry I'm a complete novice when it comes to this.Adding a custom domain to Surge requires a few steps, and errors can occur if something is misconfigured. Here’s a clear guide to help you troubleshoot:
Steps to Add a Custom Domain on Surge:
1. Deploy Your Site:
Ensure your site is already deployed on Surge. If not, run:
surge
This will generate a .surge.sh subdomain for your site.
2. Set the Custom Domain:
Use the surge CLI to set a custom domain:
surge --domain your-custom-domain.com
Replace your-custom-domain.com with your desired domain name.
3. Verify DNS Settings:
• A Records (recommended):
Point your domain’s A records to Surge’s IP address:
45.55.110.124
• CNAME Record:
If using a subdomain (e.g., www.your-custom-domain.com), set a CNAME record pointing to:
na-west1.surge.sh
4. Confirm DNS Propagation:
Use a DNS checker (like DNSChecker) to ensure your domain points to Surge’s IP or CNAME.
5. Check Domain Configuration:
Surge might give an error if:
• The DNS isn’t set correctly.
• There’s a conflict with another Surge account.
Run:
surge whoami
To verify your Surge account and correct domain ownership.
6. Verify HTTPS (Optional):
Surge automatically provides HTTPS for custom domains. If HTTPS isn’t working:
• Wait a few minutes after setting up the custom domain.
• Ensure DNS records are propagated correctly.
Common Error Messages and Fixes:
• “You do not have permission to set this domain.”
The domain might be claimed by another Surge account. Contact Surge support to resolve this.
• “Domain isn’t resolving.”
Double-check DNS records or wait for propagation (can take 24-48 hours).
• “Unable to verify domain.”
This often happens if the domain’s DNS records aren’t correctly set. Confirm settings with your domain registrar.
Let me know if you run into a specific error message, and I can help troubleshoot further! Hope this helps!
OK, it says command not found. Do I do this in the code file or do I do it just on Terminal? Sorry I'm a complete novice when it comes to this.
cd path/to/your/project
surge
surge —version
Code Forum is a community platform where coding enthusiasts can connect with other developers, engage in discussions, ask for help, and share their knowledge with a supportive community. It's a perfect place to improve your coding skills and to find a community of like-minded individuals who share your passion for coding.
We use essential cookies to make this site work, and optional cookies to enhance your experience.