> For the complete documentation index, see [llms.txt](https://docs.dnscontrol.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dnscontrol.org/language-reference/domain-modifiers/registrar.md).

# REGISTRAR

`REGISTRAR(credEntry)` selects the registrar using an entry name from creds.json.

In `D()`, `REGISTRAR()` must immediately follow the domain name.

```javascript
D("example.com",
    REGISTRAR("gandi_main"),
    SERVICE("gandi_main"),
    A("@", "192.0.2.1"),
);

D("example.net",
    REGISTRAR(),
    SERVICE("gandi_main"),
    A("@", "192.0.2.1"),
);
```

`REGISTRAR()` is an alias for `REGISTRAR("none")`, which disables registrar management. D() requires a registrar as the second parameter, therefore `REGISTRAR()` should be used as a placeholder when a domain's registrar is not managed.

`REGISTRAR` may appear in `DEFAULTS()`, but setting a `REGISTRAR` in `D()` or `D_EXTEND()` will override it for that domain.

```javascript
DEFAULTS(
    REGISTRAR(),
    SERVICE("bind", 0),
);

D("example.com", A("@", "192.0.2.1"));
D("example.net", REGISTRAR("gandi_main"), A("@", "192.0.2.2"));
```

`REGISTRAR()` may appear anywhere among the modifiers in [`D_EXTEND()`](https://docs.dnscontrol.org/language-reference/top-level-functions/d_extend.md), including inside nested arrays. It replaces the registrar previously selected by defaults, `D()` (including the legacy positional form), or an earlier extension. The last registrar assignment executed wins. Different registrar selections within a single `D_EXTEND()` call are an error; repeating the same selection is allowed.

```javascript
D("example.org", REGISTRAR("old_registrar"), SERVICE("dns_main"));
D_EXTEND("example.org",
    A("@", "192.0.2.3"),
    REGISTRAR("new_registrar"),
);

// A later extension can disable registrar management.
D_EXTEND("example.org", REGISTRAR());
```

A domain may also receive its first registrar selection through `D_EXTEND()`. Registrar selection is finalized after the script and its asynchronous callbacks finish. A domain still missing a required registrar at that point is an error. Registrar changes leave DNS services and their metadata unchanged. `REGISTRAR()` does not accept configuration metadata.

`REGISTRAR` replaces the legacy [NewRegistrar](https://docs.dnscontrol.org/language-reference/top-level-functions/newregistrar.md) function, which is still supported for now. The [conversion guide](https://docs.dnscontrol.org/getting-started/converting-dnsconfig.md) gives more details.
