MIKROTIK: new provider for Mikrotik RouterOS' DNS server#4083
MIKROTIK: new provider for Mikrotik RouterOS' DNS server#4083tlimoncelli merged 15 commits intoStackExchange:mainfrom
Conversation
|
Hello @tlimoncelli! An idea that came to my mind - Mikrotik supplies an image of RouterOS that can be (comparatively) easily ran in virtualised environments (called CHR, cloud hosted router). While I haven't tried it out myself, I think I can host it somewhere and contribute the credentials for accessing it to include the Anyway, I'm looking foward to hearing just any feedback on the provider implementation and its relevance to the project goals. Thank you! |
|
Hello friend! It's been a busy week but I hope to review this soon. Looks good so far! (and I love the idea of testing against a CHR!) Tom |
|
Thank you for contributing this new provider, @hedger ! Two notes:
Thanks again! |
|
Hi @hedger, Apologies for the delay, I thought I had already posted here. As Tom mentioned I am the Maintainer Liaison. Would you be able to send your contact email to us? You can reach me at dnscontrol at faisal dot fm and Tom at tlimoncelli at stack over flow dot com Your email will not be public and will only be used the the project team to send out maintainer communications. As a maintainer, we’d like to remind you of your role and expectations we have so that everyone has a positive experience using dnscontrol:
Thank you!! |
Summary
This PR introduces a new DNS provider for MikroTik RouterOS devices, managing DNS static entries and forwarders via the RouterOS REST API. Requires RouterOS 7.x.
I absolutely loved dnscontrol's features and the ease of management for domains it provides. However, part of my personal DNS-related infrastructure is powered by Mikrotik devices, and in order to unify configuration management I drafted this implementation. Hope others will find it an useful addition (#4013 (comment))
Changes
For the new
MIKROTIKprovider:Supported record types:
A, AAAA, CNAME, MX, NS, SRV, TXTCustom record types:
MIKROTIK_FWD: conditional DNS forwarding with address list populationMIKROTIK_NXDOMAIN: respond with NXDOMAIN for matching queriesMIKROTIK_FORWARDER: manage/ip/dns/forwardersentries via a synthetic_forwarders.mikrotikzoneROS-specific record metadata (
match_subdomain,regexp,address_list,comment) exposed as dnscontrol metadata and round-tripped through the APIZone detection: RouterOS has no native zone concept; zones are inferred from record names using configurable zonehints (longest match), publicsuffix, or last-two-labels fallback
get-zonesenhancements:{no_ns: "true"}when a provider returns no nameservers (useful for any provider without NS records, not just MikroTik)Configuration
{ "home_gateway": { "TYPE": "MIKROTIK", "host": "http://192.168.88.1:80", "username": "admin", "password": "passw0rd", "zonehints": "home.example.com" } }Usage Example
Potential improvements
apiservice with proprietary protocol on port 8728/8729 (with TLS), instead of REST API relying on thewwwserviceTests
Integration tests verified against a physical RouterOS 7.21.3 device, hap ax3