> For the complete documentation index, see [llms.txt](https://docs.tcpshield.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tcpshield.com/miscellaneous/protect-a-website.md).

# Protect a website

Using Cloudflare for web and TCPShield for Minecraft

This guide will show how to have a website protected with Cloudflare and a Minecraft protected with TCPShield. This guide assumes you have a domain on Cloudflare already.

## Step 1: Login and remove existing records

First, we need to protect our web server with Cloudflare. Let's log into Cloudflare and do that.

![Click here when you login](https://530345640-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWXTvAX8gueFZ5txjDV%2F-MWXXpXQNqrM_dge1eAq%2F-MWXY-jognDJUCg724aD%2FZRaHVWp.png?alt=media\&token=7a42d13b-c2c3-42ec-9b39-e675ea214603)

Now we will add our web server to Cloudflare. First we need to see if there are any DNS records already pointed to `@` (the base domain) or `www`.

{% hint style="info" %}
This guide will assume **example.com** is my domain
{% endhint %}

![127.0.0.1 is an example in this case](https://530345640-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWXTvAX8gueFZ5txjDV%2F-MWXXpXQNqrM_dge1eAq%2F-MWXY5ZEkqaDS9Hqnbjd%2FKeoLDaV.png?alt=media\&token=51306e22-2179-4e1b-871e-ad62528464ff)

## Step 2: Add your web server IP

Now, we will add our web server to cloudflare and proxy it. We can do that like this.

![Click here](https://530345640-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWXTvAX8gueFZ5txjDV%2F-MWXXpXQNqrM_dge1eAq%2F-MWXY8qPdSHtjCk5kGcz%2FulKnGjM.png?alt=media\&token=a4aa80c3-7250-400a-8d4d-56b735a6c98c)

![Create the new DNS record](https://530345640-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWXTvAX8gueFZ5txjDV%2F-MWXXpXQNqrM_dge1eAq%2F-MWXYBLy8Eu2cJBuLLKr%2FWgP6LKi.png?alt=media\&token=6c501989-0c27-43a7-802d-7624f36c925e)

{% hint style="info" %}
If you would like `www.` to work as well, do the same thing again but replace `@` with `www`
{% endhint %}

## Step 3: Create the SRV record

Now we have protected our website on Cloudflare! Now we will make sure players can still connect with `example.com` using no subdomain.

#### Step 3.1: Point TCPShield CNAME to a target

Create a new DNS record like this

![Create a new DNS record for the target](https://530345640-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWXTvAX8gueFZ5txjDV%2F-MWXXpXQNqrM_dge1eAq%2F-MWXYHU2dvxQytnuIZuS%2ForsV1yz.png?alt=media\&token=47b6db8b-06e9-4db3-bf6a-91dabb2f2355)

#### Step 3.2: Create the SRV

Now we make it so `example.com` takes you to your server on Minecraft. Copy the steps below.

<figure><img src="https://530345640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MWXTvAX8gueFZ5txjDV%2Fuploads%2FS3KZyhFWvd7FLc6SqTz7%2Fimage.png?alt=media&amp;token=9da8e317-a7c2-458c-9970-697e42b787cd" alt=""><figcaption><p>Copy the settings above</p></figcaption></figure>

**IMPORTANT**: The port on the SRV record has to be **25565**. That's the port TCPShield is listening on, not your backend port.

#### Step 3.3: Done

It's as easy as one two three.
