# Configure a custom Return Path

By default, Resend uses the `send` subdomain for the Return-Path address.

:::callout{intent="info"}
Domains that show `CNAME` records for sending use your Return-Path subdomain
for one record and an `r`-prefixed sibling for the other. With a Return-Path
of `outbound`, you'll be shown records for both `outbound.example.com` and
`routbound.example.com`, and both need to be added for the domain to fully
verify.
:::

You can provide a custom Return-Path address when you [add a new domain in the Dashboard](/guides/get-started-add-a-domain) under **Advanced options**, or by setting the optional `custom_return_path` parameter when [creating a domain via the API](/guides/domains-2-create-domain) or with [the `domains create` CLI command](/guides/resources-cli#domains).

:::callout{intent="note"}
The Return-Path is set when the domain is created and cannot be changed
afterwards, so `custom_return_path` is not accepted by the [Update
Domain](/guides/domains-2-update-domain) endpoint. To use a different
Return-Path subdomain, delete the domain and add it again with the new value.
:::

![Custom Return Path](../img/site-assets/mintcdn.com/resend/JHWt09hsc7E33HK2/images/dashboard-domains-resend-custom-return-path-g4wnig.png)

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

:::code-group
```ts Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

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

```php PHP theme={"theme":{"light":"github-light","dark":"vesper"}}
$resend = Resend::client('re_xxxxxxxxx');

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

```python Python theme={"theme":{"light":"github-light","dark":"vesper"}}
import resend

resend.api_key = "re_xxxxxxxxx"

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

resend.Domains.create(params)
```

```ruby Ruby theme={"theme":{"light":"github-light","dark":"vesper"}}
require "resend"

Resend.api_key = "re_xxxxxxxxx"

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

```go Go theme={"theme":{"light":"github-light","dark":"vesper"}}
package main

import "github.com/resend/resend-go/v4"

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

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

	client.Domains.Create(params)
}
```

```rust Rust theme={"theme":{"light":"github-light","dark":"vesper"}}
use resend_rs::{types::CreateDomainOptions, Resend, Result};

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

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

  Ok(())
}
```

```java Java theme={"theme":{"light":"github-light","dark":"vesper"}}
import com.resend.*;
import com.resend.core.exception.ResendException;
import com.resend.services.domains.model.CreateDomainOptions;
import com.resend.services.domains.model.CreateDomainResponse;

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

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

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

```csharp .NET theme={"theme":{"light":"github-light","dark":"vesper"}}
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI

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

```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
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"
}'
```
:::

Custom return paths must adhere to the following rules:

- Must be 63 characters or less.
- Must start with a letter, and end with a letter or number.
- Must 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.

## Related pages

- [Verified Domains](./learn-dashboard-domains-introduction.md)
- [Managing Domains](./learn-dashboard-domains-manage-domains.md)
- [Implementing DMARC](./learn-dashboard-domains-dmarc.md)
- [Implementing BIMI](./learn-dashboard-domains-bimi.md)
- [Open and Click Tracking](./learn-dashboard-domains-tracking.md)
- [Configure Transport Layer Security (TLS)](./learn-dashboard-domains-tls.md)
- [Choosing a Region](./learn-dashboard-domains-regions.md)
- [Claiming a domain](./learn-dashboard-domains-claim.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
