Skip to main content

Connecting Your Own Domain

In this article, we will explain in detail how to connect your own domain to the Tuna platform and publish a local website to the internet without a public IP, complex network configurations like VPN, and without deploying code to any server or hosting.

Publishing on your own domain can be interesting for Demo stands when you present a solution to a client. The client sees a finished solution while you haven't spent a minute on environment preparation, and you can also fix small things on the fly. However, there can be many more use cases.

Connecting a Domain

Purchasing a Domain

First, you'll need your own domain (if you don't have one). You can buy it, for example, from Reg.ru or namecheap or any other domain registrar. For examples in this article, we use the domain tuna-dev.ru.

Connecting to Tuna and Getting Settings

Go to the domain management page in your personal account and click Add domain in the top right corner.

Select Region, Type - Own domain, and enter your domain in the Domain field. In our case, it's api.tuna-dev.ru. If you have a Unicode domain, for example in one of these zones .РФ, .ДЕТИ, .ҚАЗ, you need to specify the converted punycode variant.

After specifying your domain, you will see the required DNS settings.

DNS Configuration

Go to the DNS records management panel. You will need to create a CNAME or A record in your domain's DNS settings. If you have an AAAA record specified for the selected domain, it needs to be deleted, as IPv6 is not currently supported.

Waiting for Confirmation

After creating the DNS record, you can return to your personal account and click Add. The domain will enter verification mode.

Validation usually takes from 15 minutes to 2 hours but can extend to a couple of days, depending on the DNS record TTL. The verification process is limited to 24 hours and is divided into 2 main stages:

  • DNS Check - we verify that your domain is configured correctly
  • TLS Check - we issue a Let's Encrypt certificate for your domain

If the addition process failed with a DNS error, check that you correctly created the DNS record and it points to the correct server. If everything is correct, the DNS cache may not have updated yet and you need to wait, then simply resume the verification. If the addition process failed with a TLS error, check if there are obvious errors in the DNS configuration: AAAA records, recursively looped pointers. If you can't figure it out yourself, contact support.

Usage

After successful domain verification, you will receive a notification email.

Now you can start using it. To do this, add the --domain flag or its short variant -d or an environment variable and your domain to the tuna http <your_port> command, for example:

tuna http 8080 --domain=api.tuna-dev.ru
tuna http 8080 -d api.tuna-dev.ru
export TUNA_DOMAIN=api.tuna-dev.ru
tuna http 8080