---
title: "Custom Return Path"
slug: custom-return-path
description: "Set a custom return path for your domain."
created_at: "2025-05-15"
updated_at: "2026-07-09"
image: https://cdn.resend.com/posts/custom-return-path.jpg
humans: ["isabella-aquino"]
---

When a Resend user adds a new domain, we generate DNS records for the domain. These records include an SPF record and an MX record and authorize Resend to send emails from the domain.

Until today, the host name for these records followed a hard-coded pattern: `send.yourdomain.tld.`

## Return path conflicts

While this hard-coded pattern worked for most cases, some Resend users already have existing `send.yourdomain.tld` for other services or integrations.

Attempting to add another set of records at the same location resulted in conflicts. For multi-tenant apps registering domains for their customers, our hard-coded pattern was not flexible enough.

## Set a custom return path

Today we're excited to announce you can optionally set a custom return path for your domain. The custom return path is used for SPF authentication, DMARC alignment, and handling bounced emails.

Set a custom return path via the [Resend dashboard](/domains).

<video
  src="https://cdn.resend.com/posts/custom-return-path.mp4"
  autoPlay
  loop
  muted
  playsInline
  className="extraWidth"
/>

Or set a custom return path [via the API](/docs/api-reference/domains/create-domain).

<CodeTabs codeHeight={170}>

  ```nodejs
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

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

```php
$resend = Resend::client('re_xxxxxxxxxx');

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

```python
import resend

resend.api_key = "re_xxxxxxxxx"

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

resend.Domains.create(params)
```

```ruby
Resend.api_key = ENV["RESEND_API_KEY"]

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

```go
import 	"github.com/resend/resend-go/v2"

client := resend.NewClient("re_xxxxxxxxx")

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

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

```rust
use resend_rs::{types::CreateDomainOptions, Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

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

  Ok(())
}
```

```java
import com.resend.*;

public class Main {
    public static void main(String[] args) {
        Resend resend = new Resend("re_xxxxxxxxx");

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

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

```dotnet
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" );

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

```curl
curl -X POST 'https://api.resend.com/domains' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d $'{
  "name": "example.com",
  "custom_return_path": "outbound"
}'
```

</CodeTabs>

## Key details

The return path subdomain defaults to `send` (i.e., `send.yourdomain.tld`).

Custom return path subdomains 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.

## Conclusion

We look forward to seeing how custom return paths provide additional flexibility when creating domains.









