> ## Documentation Index
> Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Up Domain

> Set up custom domains for your services with subdomain or path-based routing and DNS record configuration.

## Base Domain URL in TrueFoundry Cluster

While it's possible to access your deployed services or models using an IP address, this method has inherent limitations. For instance, with IP addresses, you cannot utilize subdomains. Domain URLs allows you to reference your services using a more intuitive and flexible URL rather than a static IP. Checkout next section for setting A record for domain.

You can configure a “base domain URL“ for handling routing to your services

## Subdomain-Based Routing:

If you set your base domain as `*.example.com`, you can access a specific services using the format: `service-1.workspace-1.example.com` and `service-2.workspace-2.example.com`

## Path-Based Routing:

Alternatively, by configuring the base domain as `example.com`, you can use path-based routing to access your services. For instance: `example.com/service-1` and `example.com/service-2`

## Setting Up Your Base Domain URL:

1. Navigate to `Integrations`.
2. Proceed to the `Cluster` page.
3. Choose the desired cluster and opt for the `Edit` option.
4. Here, you can specify your base domain URL

## Setting A Record and CNAME

The “A“ record, which stands for “Address Record“, is a type of DNS (Domain Name System) record. It maps a domain or subdomain to an IPv4 address. This means when someone accesses the domain (e.g., `example.com`), they are directed to the server with the specified IP address (eg. `81.18.118.18`).

To point a domain to your IP address using an “A“ record:

1. **Log in to your domain registrar or DNS hosting platform:** This is the service where you've registered your domain, such as GoDaddy, NameCheap, CloudFlare, or any other.

2. **Locate the DNS management section:** This might be labeled as “DNS Settings”, “Name Server Management”, “Manage Domains”, or something similar.

3. **Edit your DNS records:** Search for an option to edit or add DNS records.

4. **Add or modify the 'A' record:**

   * If you want to point the primary domain (e.g., `example.com`) to your IP address, leave the subdomain/host field blank or enter “@“.
   * For a subdomain (e.g., `sub.example.com`), enter the subdomain part (“sub“ in this case) in the host or subdomain field.
   * In the field for the IP address, enter your desired IPv4 address.
   * Save the changes

5. **Create a CNAME Record for www (Optional):**

   * If you want the www version of your domain (like `www.example.com`) to also point to your domain `example.com`, create a CNAME record.
   * The CNAME record for “www“ should point to your root domain, example.com.
   * Save the changes

6. **Wait for propagation.** Changes to DNS records can take anywhere from a few minutes to 48 hours to propagate across the internet. The exact time depends on various factors like the TTL (Time To Live) value set for your records and the caching behavior of DNS servers.

7. **Test your changes** by visiting your domain or using DNS lookup tools to verify that your domain is pointing to the correct IP address.
