# Public DNS

> Octelium documentation. Canonical page: <https://octelium.com/docs/octelium/latest/install/cluster/dns>.

> **Note:**
>
> If you are currently installing the single-node *Cluster* as shown in the quick installation guide (read more [here](https://octelium.com/docs/octelium/latest/overview/quick-install.md)), it is easier and more recommended to stick to the post-installation guide there as shown [here](https://octelium.com/docs/octelium/latest/overview/quick-install.md#post-installation).

An Octelium *Cluster* requires public DNS to receive requests publicly over the internet for its public *Services* (read more [here](https://octelium.com/docs/octelium/latest/management/core/service/clientless.md)) and public anonymous *Services* (read more [here](https://octelium.com/docs/octelium/latest/management/core/service/anonymous-access.md)). Since the Octelium *Cluster* uses a Kubernetes ingress to receive requests from the internet, all you need to do is to point your *Services* to that Kubernetes ingress public IP address.

You can get that public IP address once the *Cluster* is installed. The *Cluster* installs its own ingress during installation via an  `LoadBalancer` kubernetes service that is used by a component called [*Ingress*](https://octelium.com/docs/octelium/latest/reference/components.md#ingress).

> **Note:**
>
> Managed Kubernetes deployments (e.g. AWS EKS, Linode LKE, etc...) automatically initialize a managed load balancer with a public IP address within seconds after the creation of `LoadBalancer` services.

Once the *Cluster* is installed, you will be able to obtain that IP address by using the `kubectl get svc -n octelium octelium-ingress-dataplane` command as follows:

```bash
# We obtain the public IP address used by the ingress service `octelium-ingress-dataplane`
# in the `octelium` namespace
kubectl get svc -n octelium octelium-ingress-dataplane
# The IP address is located in the `EXTERNAL-IP` field
NAME                         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)         AGE
octelium-ingress-dataplane   LoadBalancer   1.2.3.4      <IP_ADDRESS_HERE>   443:32180/TCP   8h
```

Once you obtain that IP address value, you can use it in your DNS provider (e.g. Cloudflare, GoDaddy, Namecheap, etc...) to set public DNS entries to point all of your *Cluster*'s public *Services* to that public IP address. You need to add 2 DNS entries to be able to use the *Cluster* after installation:

- An `A` entry to resolve `<DOMAIN>` to the *Ingress* public IP address obtained above:

| Entry Field | Value                 |
| ----------- | --------------------- |
| Type        | `A`                   |
| Name / Host | `<DOMAIN>`            |
| Value       | `<PUBLIC_IP_ADDRESS>` |

- A `CNAME` entry resolving the wildcard domain `*.<DOMAIN>` to `<DOMAIN>`. This entry effectively resolves all of the `<DOMAIN>` sub-domains to the *Ingress* public IP address.

| Entry Field | Value        |
| ----------- | ------------ |
| Type        | `CNAME`      |
| Name / Host | `*.<DOMAIN>` |
| Value       | `<DOMAIN>`   |

## QUIC Mode

Octelium uses WireGuard by default for tunneling the traffic between the *Cluster* and clients. This is the default and extremely recommended way. Moreover, Octelium currently supports a QUIC-based tunneling mode. Unlike in WireGuard where clients address the *Cluster*'s *Gateways* directly by their IP addresses, QUIC uses TLS via the *Cluster* domain TLS certificate. Therefore, the octelium client addresses a *Gateway*'s QUIC server by the public hostname of that *Gateway* assigned automatically by the *Cluster*. In other words, you need to create a public `A` or `AAAA` DNS record for every *Gateway* in order to be addressed publicly by the `octelium` clients. You can find the hostname used by a specific *Gateway* provided in the `status.hostname` field as well as the public IP addresses of that *Gateway* provided in the `status.publicIPs[]` array. Here is an example:

First, you might want to list the *Cluster*'s *Gateways* as follows:

```bash
octeliumctl get gw
```

Then once you get the specific *Gateway* name, you can use it to get more information about it as follows:

```bash
octeliumctl get gw <GATEWAY_NAME> -o yaml
```

Now you can find in the `hostname` field in `status.hostname` in the YAML output of the above command as follows:

```yaml
apiVersion: core/v1
kind: Gateway
#....
status:
#!mark
  hostname: octelium-gw-wa5us38r.example.com
  # ....
#!mark(1:2)
  publicIPs:
  - 1.2.3.4
```

Once you obtain the hostname and public IP addresses of a certain *Gateway*, use them to create `A` or `AAAA` DNS records in your public DNS provider.

> **Note:**
>
> Since version `v0.44.0`, *Gateway* hostnames use the `octelium-gw-` prefix (i.e. `octelium-gw-<ID>.<DOMAIN>`) instead of the legacy `_gw-` prefix in order to comply with RFC 1123. If you upgraded a multi-node *Cluster* from an older version, then you need to update the *Gateway* hostnames in your public DNS provider accordingly. If you are using the single-node *Cluster* installed via the quick installation guide (read more [here](https://octelium.com/docs/octelium/latest/overview/quick-install.md)), then no changes are required.
