# Connect your own domain to Gyro Containers: CNAME, A record and automatic free SSL

https://www.gyrohosting.com/en/knowledgebase/article/gyro-containers-domain-and-ssl

- **What you will learn**: How to connect your own domain (for example `app.example.com`) to a public service, which DNS records to write and how the free SSL certificate is obtained automatically.
- **Time**: 10 minutes
- **Who this is for**: Anyone who wants to publish a service under their own domain.
- **What you need**: A **public** service and a place where you can manage your domain's DNS.

## 1. How it works

Every public service has a ready address: `service-name-code.gyroapp.net` (HTTPS, certificate ready). When you connect your own domain:

1. You add the domain to the service; the status is **Waiting for DNS**.
2. In your domain's DNS you point the record to the Gyro address.
3. When DNS has propagated the system verifies it; the domain becomes **Active** and the **free SSL certificate is obtained automatically** (a few minutes). The certificate renews automatically before it expires.

> **Info**
> 
> No certificate is requested for a domain whose DNS does not point to us, so write the DNS record first. Pending domains are checked automatically **every hour**; press **Check** to check immediately.

## 2. Step by step

1. Open the **Domains** page of your environment and choose the service. (The service must be **Public**; if not, turn that on in the service settings.)
2. Type `app.example.com` in the **Domain** box and press **Add**. The status becomes **Waiting for DNS**.
3. Copy the **target address** shown on the page (`service-name-code.gyroapp.net`).
4. Go to your domain's DNS management screen and write the record:

| Domain type | Record | Value |
| --- | --- | --- |
| Subdomain (`app.example.com`, `www`) | **CNAME** | `service-name-code.gyroapp.net` |
| Root domain (`example.com`) | **A** | The entry IP address(es) shown on the **Node Pool** page |

1. When the record has propagated (usually a few minutes) press **Check**. The status becomes **Active**; the certificate is ready within a few minutes.
2. Open `https://app.example.com`. You should see the lock icon in the browser.

> **Warning**
> 
> Most DNS providers do not allow a CNAME on a root domain; use an **A record**. In the A record write all the IPs on the **Node Pool** page (if there are several, all of them).

> **Warning**
> 
> If a **proxy** such as Cloudflare (orange cloud) is on, the record goes to the proxy's addresses rather than the Gyro address and the domain may not become active. Use **DNS only** (grey cloud) until the certificate is obtained.

## 3. Statuses and messages

| Status | Meaning | What to do |
| --- | --- | --- |
| **Waiting for DNS** | The domain was added but DNS does not point to us yet | Write the record / wait for propagation, press **Check** |
| **DNS record not found** | No DNS record is visible for the domain | Check the record name and value |
| **DNS points elsewhere** | The record does not go to our address | Change the old record; turn off the proxy |
| **Active** | The domain is connected; SSL obtained | — |

To remove a domain use the delete button on the row ("Remove {domain}?"); its certificate is removed too.

## 4. From the command line

```
gyro container domain add 12345 web --domain app.example.com
gyro container domain list 12345 web
gyro container domain verify 12345 web
gyro container domain remove 12345 web app.example.com
```

## 5. Frequently asked questions

**Can I connect a wildcard ( *.example.com ) domain?**

No; wildcard domains are not supported. Add each domain separately.

**Can I add the same domain to two services?**

No. A domain can be used in only one service (and one environment); you get "Domain is used in another service". Remove it from the first one.

**My domain limit is full; what should I do?**

The domain limit per service is 5/10/20 depending on the package. Move to a higher package for more.

**Can I connect both example.com and www.example.com ?**

Yes; add them as two domains: an A record for the root and a CNAME for `www`.

**Can I add Gyro's own domains?**

No; names under `gyroapp.net` and domains reserved for Gyro cannot be added.

## Next step

- [Scaling, updating and rollback](https://www.gyrohosting.com/en/knowledgebase/article/gyro-containers-scaling-updating-rollback)
- [Logs and graphs](https://www.gyrohosting.com/en/knowledgebase/article/gyro-containers-logs-and-graphs)
