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

# Managing Domains

> Visualize all the domains on the Emailr Dashboard.

<Warning>
  Domain not verifying? [Try
  this](/docs/guides/knowledge-base/what-if-my-domain-is-not-verifying).
</Warning>

## Verifying a domain

Emailr sends emails using a domain you own.

We recommend using subdomains (e.g., `updates.yourdomain.com`) to isolate your sending reputation and communicate your intent. Learn more about [using subdomains](/docs/guides/knowledge-base/is-it-better-to-send-emails-from-a-subdomain-or-the-root-domain).

In order to verify a domain, you must set two DNS entries:

1. [SPF](#what-are-spf-records): list of IP addresses authorized to send email on behalf of your domain
2. [DKIM](#what-are-dkim-records): public key used to verify email authenticity

These two DNS entries grant Emailr permission to send email on your behalf. Once SPF and DKIM verify, you can optionally add a [DMARC record](/docs/guides/dashboard/domains/dmarc) to build additional trust with mailbox providers.

<Info>
  Emailr requires you own your domain (i.e., not a shared or public domain).
</Info>

## View domain details

The [Domains dashboard](https://app.emailr.dev/dashboard/domains) shows information about your domain name, its verification status, and history.

<img alt="Screenshot placeholder" src="https://mintcdn.com/emailrdev/tSm2WeCvU8-lHmTx/images/placeholder.svg?fit=max&auto=format&n=tSm2WeCvU8-lHmTx&q=85&s=93891ced94bad8f8c38f90b5be99f73c" width="800" height="450" data-path="images/placeholder.svg" />

<Info>
  Need specific help with a provider? View our [knowledge base DNS
  Guides](/docs/guides/knowledge-base).
</Info>

## What are SPF records

Sender Policy Framework (SPF) is an email authentication standard that allows you to list all the IP addresses that are authorized to send email on behalf of your domain.

The SPF configuration is made of a TXT record that lists the IP addresses approved by the domain owner. It also includes a MX record that allows the recipient to send bounce and complaint feedback to your domain.

<img alt="Screenshot placeholder" src="https://mintcdn.com/emailrdev/tSm2WeCvU8-lHmTx/images/placeholder.svg?fit=max&auto=format&n=tSm2WeCvU8-lHmTx&q=85&s=93891ced94bad8f8c38f90b5be99f73c" width="800" height="450" data-path="images/placeholder.svg" />

## Custom Return Path

By default, Emailr will use the `send` subdomain for the Return-Path address. You can change this by setting the optional `custom_return_path` parameter when [creating a domain](/docs/api/domains/add-domain) via the API or under **Advanced options** in the dashboard.

<img alt="Screenshot placeholder" src="https://mintcdn.com/emailrdev/tSm2WeCvU8-lHmTx/images/placeholder.svg?fit=max&auto=format&n=tSm2WeCvU8-lHmTx&q=85&s=93891ced94bad8f8c38f90b5be99f73c" width="800" height="450" data-path="images/placeholder.svg" />

For the API, optionally pass the custom return path parameter.

<CodeGroup>
  ```ts Node.js theme={null} theme={null}
  import { Emailr } from 'emailr';

  const emailr = new Emailr('em_xxxxxxxxx');

  emailr.domains.create({ name: 'example.com', customReturnPath: 'outbound' });
  ```

  ```php PHP theme={null} theme={null}
  $emailr = Emailr::client('em_xxxxxxxxx');

  $emailr->domains->create([
    'name' => 'example.com',
    'custom_return_path' => 'outbound'
  ]);
  ```

  ```python Python theme={null} theme={null}
  import emailr

  emailr.api_key = "em_xxxxxxxxx"

  params: emailr.Domains.CreateParams = {
    "name": "example.com",
    "custom_return_path": "outbound"
  }

  emailr.Domains.create(params)
  ```

  ```ruby Ruby theme={null} theme={null}
  Emailr.api_key = ENV["EMAILR_API_KEY"]

  params = {
    name: "example.com",
    custom_return_path: "outbound"
  }
  domain = Emailr::Domains.create(params)
  puts domain
  ```

  ```go Go theme={null} theme={null}
  import 	"github.com/emailr/emailr-go/v3"

  client := emailr.NewClient("em_xxxxxxxxx")

  params := &emailr.CreateDomainRequest{
      Name: "example.com",
      CustomReturnPath: "outbound",
  }

  domain, err := client.Domains.Create(params)
  ```

  ```rust Rust theme={null} theme={null}
  use emailr_rs::{types::CreateDomainOptions, Emailr, Result};

  #[tokio::main]
  async fn main() -> Result<()> {
    let emailr = Emailr::new("em_xxxxxxxxx");

    let _domain = emailr
      .domains
      .add(CreateDomainOptions::new("example.com").with_custom_return_path("outbound"))
      .await?;

    Ok(())
  }
  ```

  ```java Java theme={null} theme={null}
  import com.emailr.*;

  public class Main {
      public static void main(String[] args) {
          Emailr emailr = new Emailr("em_xxxxxxxxx");

          CreateDomainOptions params = CreateDomainOptions
                  .builder()
                  .name("example.com")
                  .customReturnPath("outbound")
                  .build();

          CreateDomainResponse domain = emailr.domains().create(params);
      }
  }
  ```

  ```csharp .NET theme={null} theme={null}
  using Emailr;

  IEmailr emailr = EmailrClient.Create( "em_xxxxxxxxx" ); // Or from DI

  var resp = await emailr.DomainAddAsync( new DomainAddData {
     DomainName = "example.com",
     CustomReturnPath = "outbound"
  } );
  Console.WriteLine( "Domain Id={0}", resp.Content.Id );
  ```

  ```bash cURL theme={null} theme={null}
  curl -X POST 'https://api.emailr.dev/domains' \
       -H 'Authorization: Bearer em_xxxxxxxxx' \
       -H 'Content-Type: application/json' \
       -d $'{
    "name": "example.com",
    "custom_return_path": "outbound"
  }'
  ```
</CodeGroup>

Custom return paths must adhere to the following rules:

* Must be 63 characters or less
* Must start with a letter, end with a letter or number, and contain only letters, numbers, and hyphens

Avoid setting values that could undermine credibility (e.g. `testing`), as they may be exposed to recipients in some email clients.

## What are DKIM records

DomainKeys Identified Mail (DKIM) is an email security standard designed to make sure that an email that claims to have come from a specific domain was indeed authorized by the owner of that domain.

The DKIM configuration is made of a TXT record that contains a public key that is used to verify the authenticity of the email.

<img alt="Screenshot placeholder" src="https://mintcdn.com/emailrdev/tSm2WeCvU8-lHmTx/images/placeholder.svg?fit=max&auto=format&n=tSm2WeCvU8-lHmTx&q=85&s=93891ced94bad8f8c38f90b5be99f73c" width="800" height="450" data-path="images/placeholder.svg" />

## Understand a domain status

Domains can have different statuses, including:

* `not_started`: You've added a domain to Emailr, but you haven't clicked on `Verify DNS Records` yet.
* `pending`: Emailr is still trying to verify the domain.
* `verified`: Your domain is successfully verified for sending in Emailr.
* `failed`: Emailr was unable to detect the DNS records within 72 hours.
* `temporary_failure`: For a previously verified domain, Emailr will periodically check for the DNS record required for verification. If at some point, Emailr is unable to detect the record, the status would change to "Temporary Failure". Emailr will recheck for the DNS record for 72 hours, and if it's unable to detect the record, the domain status would change to "Failure". If it's able to detect the record, the domain status would change to "Verified".

## Open and Click Tracking

Open and click tracking is disabled by default for all domains. You can enable it by clicking on the toggles within the domain settings.

<img alt="Screenshot placeholder" src="https://mintcdn.com/emailrdev/tSm2WeCvU8-lHmTx/images/placeholder.svg?fit=max&auto=format&n=tSm2WeCvU8-lHmTx&q=85&s=93891ced94bad8f8c38f90b5be99f73c" width="800" height="450" data-path="images/placeholder.svg" />

<Info>
  For best deliverability, we recommend disabling click and open tracking [for
  sensitive transactional
  emails](/docs/guides/dashboard/emails/deliverability-insights#disable-click-tracking).
</Info>

## How Open Tracking Works

A 1x1 pixel transparent GIF image is inserted in each email and includes a unique reference to this image file. When the image is downloaded, Emailr can tell exactly which message was opened and by whom.

## How Click Tracking Works

To track clicks, Emailr modifies each link in the body of the HTML email. When recipients open a link, they are sent to a Emailr server, and are immediately redirected to the URL destination.

## Export your data

Admins can download your data in CSV format for the following resources:

* Emails
* Broadcasts
* Contacts
* Segments
* Domains
* Logs
* API keys

<Info>Currently, exports are limited to admin users of your team.</Info>

To start, apply filters to your data and click on the "Export" button. Confirm your filters before exporting your data.

<img alt="Video placeholder" src="https://mintcdn.com/emailrdev/tSm2WeCvU8-lHmTx/images/placeholder.svg?fit=max&auto=format&n=tSm2WeCvU8-lHmTx&q=85&s=93891ced94bad8f8c38f90b5be99f73c" width="800" height="450" data-path="images/placeholder.svg" />

If your exported data includes 1,000 items or less, the export will download immediately. For larger exports, you'll receive an email with a link to download your data.

All admins on your team can securely access the export for 7 days. Unavailable exports are marked as "Expired."

<Note>
  All exports your team creates are listed in the
  [Exports](https://app.emailr.dev/dashboard) page under **Settings** > **Team** >
  **Exports**. Select any export to view its details page. All members of your
  team can view your exports, but only admins can download the data.
</Note>
