The ISC’s DHCP server has the ability to do zone updates to other hosts’ DNS servers (establishing forward and reverse DNS records for all hosts). This would be a feature I’d like to have in RouterOS.
It’s possible to do this with scripts, but they have to run periodically to add / remove entries. Having this natively supported from the DHCP server would be much nicer.
Running those scripts on schedule is not the only available option. A better approach is to use the lease-script DHCP server’s parameter.
One thing to note about all of this scripting:
OP requested reverse DNS… and also mentions zone updates (i.e. DDNS push). Unfortunately this second criteria pretty much takes Mikrotik out of the running for this solution, script or otherwise. (unless the DNS server with the associated PTR records also has some kind of web-based way to update the records that could be done using the fetch tool).
The dns-update tool in Mikrotik only supports A records as far as I can tell. Reverse DNS uses PTR records, so that’s a no-go on dns-update no matter how clever you get with script triggering.
The other option would be if it only needs to be in LOCAL DNS - in which case the script could simply add/remove entries in the Mikrotik’s DNS static cache. The host names could be added as client-id.local <—> IP address, which would create both the A and PTR records in the Mikrotik’s cache. But this data would not be publishable into public DNS. This is fine so long as you’re prepared to accept that internally, your hosts will be hostname.local and the IP addresses will resolve to hostname.local in rDNS.
I thought of DNS delegation to point at the Mikrotik, but since the Mikrotik doesn’t think of itself as an authoritative DNS server, you can’t even delegate the rDNS for that subnet to the Mikrotik because un-defined IP addresses would simply be queried in public DNS, which would point back to the Mikrotik, which would be queried to public DNS, loop, loop, loop, timeout. Of course, it would be possible to always have names in the cache for all 256 values of the 4th octet, and the script simply changes the associated name upon lease/expiration… but this would be a kludge at best.
It would be better if dns-update were able to push other RR types like PTR and AAAA.
Thank you for your responses. It seems that Mikrotik’s DHCP server cannot do what I require because of what ZeroByte said about the dns-update tool not supporting PTR records.