This tutorial explains how to set up a custom domain for your Hossted Marketplace application.
1. Preparation
Before starting, ensure that:
- You have the IP address of your server where the application is deployed.
- You have access to the DNS management interface (in our case, Cloudflare) dashboard and the server running your application.
Wait till the end of the deployment process.
2. Setting Up DNS Records in Cloudflare
- Log in to DNS Dashboard (Cloudflare, GoDaddy).
- Go to the DNS section and add the necessary records for your domain:
A-record
– Name: (add the name of the app or your desired subdomain).
– IPv4 Address: (add Ip address of application).
– Proxy Status: Enable (orange cloud) to use Cloudflare features.
A DNS record links a domain name to an IP address, so when a user enters (for example: cal.hossted.net), the request is automatically redirected to the server where the application is running.
- Verify the DNS setup:
Run the following command:
nslookup [domain]
Example:
nslookup cal.hossted.net
- Ensure the returned IP matches your server.
3. Configuring the Application on the Server
- Ensure the Application is Running:
Log into the server via SSH:
ssh -i [your key] ubuntu@IP
- Bind the Domain to the Application:
sudo hossted set domain (domain)
Example:
sudo hossted set domain cal.hossted.net
This will add the domain to the application’s configuration and restart related services.
- Verify Configuration:
curl -I (your link to the application with your domain)
Example:
curl -I cal.hossted.net
4. Testing the Domain
Test the application through the domain:
- Open your new application link (as it was given as an example cal.hossted.net) in a browser.
- Confirm the application is accessible.
Verify IP and domain availability:
nslookup [domain]
ping [domain]
Example:
nslookup cal.hossted.net
ping cal.hossted.net