Community discussions

MikroTik App
User avatar
just joined
Topic Author
Posts: 10
Joined: Tue Mar 06, 2018 4:34 pm

Sync DHCP hostnames and DNS entries

Sun Jan 10, 2021 9:10 am

I tried to write a script to create/update static DNS recods for each DHCP lease. Unfortunately, I got following problems:
  • DHCP server lease-script does not execute after changing hostname on client and reconnecting
  • Missing timeout option for static DNS entries. So in my case it's not possible to remove old dns records automatically
  /ip dhcp-server
 set [find name=lan-dhcp] lease-script="/beep"
 hostnamectl set-hostname testing
systemctl restart network-manager
[admin@mikrotik] /ip dhcp-server lease> /ip dhcp-server lease print 
Flags: X - disabled, R - radius, D - dynamic, B - blocked 
 #   ADDRESS                                  MAC-ADDRESS       HOST-NAME           SERVER         RATE-LIMIT     STATUS  LAST-SEEN                                  
 0 D                            9C:DA:3E:XX:XX:XX testing             lan-dhcp                      bound   2m17s
DHCP lease updated, but script didn't run.

Feature request: Add option to sync DHCP hostnames and DNS entries
I'm wondering is it possible to add this feature in next releases. According to a huge amount of scripts and instructons over the Internet, this feature important for a lot of clients.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], eworm, Google [Bot], Kraken2k, kuldik and 247 guests