> 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/service-provider-specific/mikrotik-routeros/mikrotik_forwarder.md).

# MIKROTIK\_FORWARDER

`MIKROTIK_FORWARDER` manages a RouterOS DNS forwarder entry (`/ip/dns/forwarders`). The `name` parameter can be a domain name (e.g. `corp.example.com`) or an arbitrary alias (e.g. `my-upstream`). These named entries can then be referenced as the target of [`MIKROTIK_FWD`](/language-reference/domain-modifiers/service-provider-specific/mikrotik-routeros/mikrotik_fwd.md) records.

Forwarder records must be placed in the synthetic zone `_forwarders.mikrotik`. This zone should appear **before** any zones that reference its entries by name in `dnsconfig.js` to ensure proper creation order.

See the [MikroTik RouterOS provider page](/provider/mikrotik.md) for full configuration details.

Metadata keys supported:

| Key               | Description                                     |
| ----------------- | ----------------------------------------------- |
| `doh_servers`     | DoH server URLs for this forwarder.             |
| `verify_doh_cert` | Set to `"true"` to verify the DoH certificate.  |
| `comment`         | Comment stored on the RouterOS forwarder entry. |

{% code title="dnsconfig.js" %}

```javascript
D("_forwarders.mikrotik", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
    // Domain-based forwarder: forward corp.example.com to internal DNS servers.
    MIKROTIK_FORWARDER("corp.example.com", "10.0.0.53,10.0.0.54"),

    // Alias-based forwarder with DoH.
    MIKROTIK_FORWARDER("doh-upstream", "1.1.1.1", {doh_servers: "https://cloudflare-dns.com/dns-query", verify_doh_cert: "true"}),
);

// Then reference the alias in a FWD record:
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
    MIKROTIK_FWD("@", "doh-upstream", {match_subdomain: "true"}),
);
```

{% endcode %}
