# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dnscontrol.org/language-reference/domain-modifiers/service-provider-specific/mikrotik-routeros/mikrotik_forwarder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
