> For the complete documentation index, see [llms.txt](https://wiki.bot-hosting.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.bot-hosting.net/guides/linking-a-domain-to-your-server.md).

# Linking a domain to your server

This guide is for running an HTTP server that you want to link your domain to, through our reverse proxy.

To begin, you will need to get your numerical server ID (not to be confused with it's UUID). Your numerical server ID is a number. The easiest way to get this at the moment is on your server's manage server page where you can find the ID in the URL.

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2FwcRnxj645C7dCRRRX73i%2FUntitled.png?alt=media&amp;token=d3f21da8-78a9-43fe-8087-53eac3b958be" alt=""><figcaption><p>Get your server ID in the url.</p></figcaption></figure>

Ok great, now you have your server ID you simply need to add a CNAME record pointing to `<your server ID>.site.bot-hosting.cloud`. For example with my ID, 8787, I would point it at `8787.site.bot-hosting.cloud`.

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2FlditnK3oyhFo2NrpyTRR%2Fimage.png?alt=media&amp;token=d7b2571c-b8a3-4883-96de-e1bf8d6d2a99" alt=""><figcaption></figcaption></figure>

You can set the name to `@` to use your root domain name without any subdomain.

## Getting a TLS certificate

{% hint style="info" %}
If you want to be able to visit your site with HTTPS you need a TLS certificate.
{% endhint %}

We recommend you use Cloudflare for getting a TLS certificate, it's free and works great. Firstly if you have not already, you need to move your domain's name servers to Cloudflare by signing up at <https://dash.cloudflare.com> and setting it up.

Then you need to setup a CNAME record same as above but this time make sure the `Proxy status` option is checked.

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2F74353wKREBlYznfRiabU%2Fimage.png?alt=media&amp;token=88b3a9d9-13c8-4239-9fb7-2ff6cdda6f5a" alt=""><figcaption></figcaption></figure>

But this alone won't work. Since you are now passing the connection through a proxy, we can't figure out what target you're connecting to, so you need to add a `TXT` record as well. This TXT record should contain `bh-server=<your server ID>`.

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2FMrauz7tGaTNEBi3iQZeG%2Fimage.png?alt=media&amp;token=3c626070-ab05-4da9-b977-36d0ceaff6f8" alt=""><figcaption><p>A TXT record for which server to target.</p></figcaption></figure>

Make sure you have SSL/TLS Encryption Mode set to flexible. Now you should be able to visit your domain through an HTTPS connection in your browser.

<figure><img src="https://806961661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMFuI5KJS4gyto7zpZWS0%2Fuploads%2FdZ5tbl9JSZZkiae9EvWY%2Fimage.png?alt=media&amp;token=49e5fe71-c5eb-4479-b92d-f680f41a3eaf" alt=""><figcaption></figcaption></figure>
