What it does
The DNS page keeps static DNS records in the manager and writes them to the routers you choose, so the same names resolve the same way everywhere. The manager is the source: you add a record once, and every router it applies to gets a copy. Types A, AAAA and CNAME are supported. (v1.106.0+)
Nothing is written to a router until you switch sync on for it. Until then the page is a list of records and the device tab shows what a sync would do.
Records and where they apply
A record applies to every device, to one site, or to one device. A router gets all three sets: the records for every device, those for its site and its own. When two of them have the same name and type, the narrower one wins on that router, so a site can give a name its own address and one device can differ again.
Each record has a name, a type, a value (an address, or the target name for a CNAME), a TTL, whether it also answers every subdomain, whether it is disabled, and an optional note. The TTL is one hour unless you set it, and takes the forms RouterOS uses, such as 30m, 1h30m or 1d 02:00:00. Names are stored in lower case without a trailing dot, and an IPv6 address in its short form. The note stays in the manager and is not written to the router. One scope cannot hold the same name and type twice.
Filter the page by a site or a device to see exactly what those routers get, records for every device included. A record that a narrower one replaces there is marked overridden. The Sites page has a DNS link on each site that opens the page filtered to it.
Deleting a site or a device deletes the DNS records kept for it, and the confirmation says how many there are.
The DNS tab on a device
The device page has a DNS tab that lists the router's own static entries. It reads them when you open the tab and on Refresh, never in the background. Dynamic entries are hidden behind Show dynamic. If the router cannot be read, the tab says so instead of showing an empty list. SNMP-only devices have no DNS tab.
Under the entries the tab shows what a sync would change on this router: records to add, entries to change, entries the manager would take over, marked entries it would remove, and duplicates it would leave alone. While sync is off for the device this is only a preview.
Sync
Sync is off everywhere until you switch it on, either for a site (on the DNS page filtered to that site) or for one device (Sync settings on its DNS tab). A device's own setting beats its site's, so a router can stay out of a site-wide sync or run on its own interval. The interval is 5 to 1440 minutes, 15 by default.
Turning sync on shows what the first pass will change before it runs. For a site that means reading every router that follows the site setting.
The entries the manager writes carry the comment mikr-dns on the router. A pass reads the router, makes the changes and reads it again, and the second read decides the result: OK, Partly applied or Failed. On the router:
- A record the router lacks is added.
- A marked entry that differs from its record is set back, including one changed by hand on the router.
- An unmarked entry with the same name and type as a record is taken over. Its old value and comment go into the history, so it can be put back.
- A second entry with the same name and type is left alone and reported as a duplicate.
- A marked entry that no record asks for any more, because the record was deleted or the device left its scope, is removed.
- Other entries and every dynamic entry are never touched.
Sync now on the device tab runs a pass at once, and Sync all now on the DNS page runs one on every router you can see that has sync on, or only on those of the site in view. A scheduled pass skips a router that was offline at the last poll, and the router is caught up on its first pass after it is back.
The history keeps every pass that changed something or failed, the last 100 per device, with what was added, changed, taken over or removed. A pass that found nothing to do only updates the last-pass line.
Importing from a router
Import into mikr on a device's DNS tab turns entries the router already has into records. It lists the entries the manager can keep (A, AAAA and CNAME entries with a name, not dynamic), each with a tick box, and says how many others were left out. Choose the scope to keep them for: every device, the device's site, or the device alone. An entry already kept for that scope with the same name and type is marked already in mikr and unticked.
The values are read from the router at the moment you import, and the TTL, subdomain setting and disabled state come with them. The entry's comment becomes the record's note. Nothing is written to the router by the import; once sync is on, the next pass takes the entries over and changes only their comment.
Who can do what
Every role can read the records for every device and those for the sites and devices it can see. Operators and administrators add, change, delete and import records and change sync settings inside their own sites. A record for every device lands on every router, so only an account that sees the whole fleet can create or change one. Viewers read. Record changes, imports, sync settings and manual sync runs are recorded in the Activity log.