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

# Multi-Domain & Conditional Records

> Configuring conditionalRecords, pendingDomains, and processedDomains for multi-domain flows.

## Conditional records object

If you have different sets of records you need to configure depending on whether it’s a root domain, a subdomain, or you’re using custom name‑servers, then this is the best option for you. You just need to include three separate objects `rootNS`, `domain` and `subDomain` and the resolver will pick the right one: whenever the `rootNS` key is found it takes absolute precedence; if your provider doesn’t support NS modifications (or `rootNS` is absent), it falls back to `subDomain` for any subdomains, and finally to the `domain` records object.

Sample conditional records object:

```
{
  ...,
  dnsRecords: {
    domain: [
      {
        type: "A",
        host: "@",
        value: "1.2.3.4",
        ttl: 300,
      },
      {
        type: "TXT",
        host: "@",
        value: "123-example-txt-record",
        ttl: 300,
      }
    ],
    subDomain: [
      {
        type: "CNAME",
        host: "shop",
        value: "myapp.com",
        ttl: 300,
      },
      {
        type: "TXT",
        host: "@",
        value: "123-example-txt-record",
        ttl: 300,
      }
    ],
    rootNS: [
      {
        type: "NS",
        host: "@",
        value: "ns1.sampleprovider.com",
        ttl: 300,
      },
      {
        type: "NS",
        host: "@",
        value: "ns2.sampleprovider.com",
        ttl: 300,
      }
    ]
}
```

## Multi-domain flows

With Entri, you can configure as many domains as you need using the end user flow. In order to achieve it, you only need to use a similar `dnsRecords` structure as the conditional records, in combination with the array form of the `prefilledDomain` property.

This is a sample configuration for a multi-domain flow:

```
{
  //...
  prefilledDomain: ["firstDomain.com", "secondDomain.com"],
  dnsRecords: {
    "firstDomain.com": [
      {
        type: "A",
        host: "@",
        value: "1.2.3.4",
        ttl: 300,
      },
      {
        type: "TXT",
        host: "@",
        value: "123-example-txt-record",
        ttl: 300,
      }
    ],
    "secondDomain.com": [
      {
        type: "CNAME",
        host: "shop",
        value: "myapp.com",
        ttl: 300,
      },
      {
        type: "TXT",
        host: "@",
        value: "123-example-txt-record",
        ttl: 300,
      }
    ]
}
```
