Skip to content

Add cname-domain override and lowercase normalization to dhcp-to-dns#123

Draft
witul wants to merge 3 commits into
eworm-de:mainfrom
witul:feature/dhcp-to-dns-cname-domain
Draft

Add cname-domain override and lowercase normalization to dhcp-to-dns#123
witul wants to merge 3 commits into
eworm-de:mainfrom
witul:feature/dhcp-to-dns-cname-domain

Conversation

@witul
Copy link
Copy Markdown

@witul witul commented May 5, 2026

Two improvements to dhcp-to-dns:

  1. Allow a separate domain for CNAME records (A records keep their
    MAC-based name in the technical domain, CNAMEs can resolve to a
    cleaner one). Configurable at three levels:

    • global: DhcpToDnsCnameDomain in global-config-overlay
    • per network: cname-domain= in DHCP network comment
    • per lease: cname-domain= in DHCP lease comment (highest priority)
  2. Normalize generated DNS names to lowercase. DHCP clients often send
    mixed-case hostnames (e.g. DESKTOP-ABC123, iPhone-XYZ). A new
    ToLower helper in global-functions is used for both the MAC-based
    A record name and the hostname CNAME.

@eworm-de
Copy link
Copy Markdown
Owner

Hmm, why is this marked as draft? Anyway, found this interesting and reworked it a bit.

This is the current state, currently in staging branch: https://github.com/eworm-de/routeros-scripts/commits/1833e72a0060f02e2cfc8795b45f5a34237faca1

  • split this a little more to separate the changes, for example having the conversion to lower case in its own commit
  • reordered a bit, the conversion to lower case is not applied to full name
  • dropped to global configuration ($DhcpToDnsCnameDomain) - I think that cases more confusion than it helps... Is that ok with you?

Feedback welcome... An thanks a lot for your contribution!

@eworm-de
Copy link
Copy Markdown
Owner

Oh, just remembered... We can use :convert with transform=lc. Will update later...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants