Skip to content

Instantly share code, notes, and snippets.

View PierpaoloPernici's full-sized avatar
🏠
Working from home

Pierpaolo 'pier' Pernici PierpaoloPernici

🏠
Working from home
View GitHub Profile
@SmartFinn
SmartFinn / dhcp-leases-to-dns.rsc
Last active March 25, 2024 07:07
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
:local dnsTTL "00:15:00";
:local token "$leaseServerName-$leaseActMAC";
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone")
# - truncate length to 63 chars