---
title: Domain management
source: https://docs.newrelic.com/docs/streaming-video-&-ads/installation/roku/agent-api/domain-management/overview
---

## Domain management methods

| Method                                                                                                                                                | Description                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [nrAddDomainSubstitution](https://docs.newrelic.com/docs/streaming-video-&-ads/installation/roku/agent-api/domain-management/nradddomainsubstitution) | Add a matching pattern for the domain attribute and substitute it by another string. Every time an event or metric is generated with a domain attribute, tha agent will check if it matches a regex and will apply the specified substitution. If no pattern is set, it will use the URL domain unchanged. It applies to all events and metrics containing the "domain" attribute. |
| [nrDelDomainSubstitution](https://docs.newrelic.com/docs/streaming-video-&-ads/installation/roku/agent-api/domain-management/nrdeldomainsubstitution) | Delete a matching pattern created with `nrAddDomainSubstitution`.                                                                                                                                                                                                                                                                                                                  |

## Examples

### nrAddDomainSubstitution

```js
  	nrAddDomainSubstitution(nr, "^.+\.my\.domain\.com$", "mydomain.com")
```

### nrDelDomainSubstitution

```js
  	nrDelDomainSubstitution(nr, "^.+\.my\.domain\.com$")
```
