Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

How do I add a custom surge domain name?

Edrol97

Bronze Coder
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
 
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

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!
 
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.
 
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.

Hello,

From my understanding you will open terminal, and navigate to your project files:

cd path/to/your/project

And afterwards you will run:

surge

After you deploy you run the commands above you will then use the other commands to setup your custom domain, This is from what I’ve read online. Let me know if you run into anymore issues.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom