Skip to content

Enhance dhcp-to-dns: VLAN-aware domains, hostname handling, ARP static IPs, and CSV-based subdomain overrides for ambiguous hostnames #115

@PackElend

Description

@PackElend

Feature request:

Extend dhcp-to-dns to support:

  1. Per-VLAN domain (configurable via VLAN comment with optional placeholders filled from Global Configruation).
  2. Scope option to process all IPs or only active VLANs (opt-in flag in comment).
  3. static IP to dns by reading ARP table (for devices without DHCP lease).
  4. CSV mapping of MAC → custom to resolve ambiguous hostnames.

Background

For example, high-value smart switches such as those from Dingz do not allow the hostname to be changed, resulting in DNS entries such as dingz-C52834.local.net.
As VLANs are used by users without direct relations, it should be possible to allow them to have one main domain per VLAN, which would improve the user experience and perhaps make the DNS entries easier to group.
Additionally, devices such as MikroTik networking devices use static IP addresses and do not appear in DHCP leases; however, they should still be included in DNS for the sake of completeness.

I would like to extend the existing routeros-scripts/dhcp-to-dns.rsc at main · eworm-de/routeros-scripts and few additional scripts (pushed to routeros-scripts/mod at main · eworm-de/routeros-scripts).

Proposal

  1. adapt routeros-scripts/dhcp-to-dns.rsc at main · eworm-de/routeros-scripts
    1. to respect VLAN specific domains
    2. Scope control (only creates DNS entries for IPs in the defined VLAN and/or IP range
    3. use custom hostnames
  2. create script arp-to-dns to
    1. create DNS entries for hosts with known IP but without DHCP lease. Only do this for hosts that are seen/alive.
    2. In general, this script should behave as routeros-scripts/dhcp-to-dns.rsc at main · eworm-de/routeros-scripts
  3. create script CSV-to-HostnameTable
    1. is looked up by the previously defined scripts to check if there is a MAC match. If so, it takes the host name defined there.
    2. The file can be located anywhere; it will be pulled by fetch. URL(s) are defined in Global Configruation.
    3. The CSV file contains two columns: MAC and hostname.

Workflow

To implement this, I plan to create several PRs:

Scripts to be touched

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions