From 428478e6902f56ef05105802068b1125fd7bd7ad Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 16 Mar 2026 11:18:40 +0100 Subject: [PATCH 1/6] dhcp-to-dns: remove unused variable --- dhcp-to-dns.rsc | 1 - 1 file changed, 1 deletion(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index 94c7492e..70567509 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -51,7 +51,6 @@ active-address=($DnsRecordVal->"address") server=($DnsRecordInfo->"server") status=bound ] ] > 0) do={ $LogPrint debug $ScriptName ("Lease for " . $MacInServer . " (" . $DnsRecordVal->"name" . ") still exists. Not deleting record."); } else={ - :local Found false; $LogPrint info $ScriptName ("Lease expired for " . $MacInServer . ", deleting record (" . $DnsRecordVal->"name" . ")."); /ip/dns/static/remove $DnsRecord; /ip/dns/static/remove [ find where type=CNAME comment=($DnsRecordVal->"comment") ]; From 87f7495534c7a6e064e37711a7066cd9d5655627 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Mar 2026 09:43:18 +0100 Subject: [PATCH 2/6] check-certificates: try renew with common-name or subject-alt-name only One of these is required to assemble the url. --- check-certificates.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index e5683514..194247c6 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -164,7 +164,8 @@ } $WaitFullyConnected; - :foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime ] do={ + :foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime \ + (common-name or subject-alt-name) ] do={ :local CertVal [ /certificate/get $Cert ]; :local LastName; :local FetchName; From 6d5274c5b106c986b7ad91bd3916821156c2421f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Mar 2026 09:45:00 +0100 Subject: [PATCH 3/6] check-certificates: change order of conditions... ... to better match both loops. --- check-certificates.rsc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 194247c6..7e2fed04 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -164,8 +164,8 @@ } $WaitFullyConnected; - :foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime \ - (common-name or subject-alt-name) ] do={ + :foreach Cert in=[ /certificate/find where !revoked !scep-url expires-after<$CertRenewTime \ + !ca (common-name or subject-alt-name) ] do={ :local CertVal [ /certificate/get $Cert ]; :local LastName; :local FetchName; @@ -245,8 +245,8 @@ } } - :foreach Cert in=[ /certificate/find where !revoked !scep-url !(expires-after=[]) \ - expires-after<$CertWarnTime !(fingerprint=[]) ] do={ + :foreach Cert in=[ /certificate/find where !revoked !scep-url expires-after<$CertWarnTime \ + !(expires-after=[]) !(fingerprint=[]) ] do={ :local CertVal [ /certificate/get $Cert ]; :if ([ :len [ /certificate/scep-server/find where ca-cert=($CertVal->"ca") ] ] > 0) do={ From 65f101eb48f42c3051053d643caf772a7e79cd54 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Mar 2026 11:23:28 +0100 Subject: [PATCH 4/6] doc/dhcp-to-dns: add a note on reverse lookup https://github.com/eworm-de/routeros-scripts/discussions/94 https://github.com/eworm-de/routeros-scripts/issues/104 https://github.com/eworm-de/routeros-scripts/issues/120 ... and possibly more. --- doc/dhcp-to-dns.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/dhcp-to-dns.md b/doc/dhcp-to-dns.md index 3636dfa3..a7e7a680 100644 --- a/doc/dhcp-to-dns.md +++ b/doc/dhcp-to-dns.md @@ -80,6 +80,23 @@ Note this information can be configured in wireless access list with then due to script execution order. Decrease the scheduler interval to reduce the effect. +Frequently asked questions +-------------------------- + +### Is it possible to have the hostname in reverse lookup? + +It used to be like that in the beginning. But there are way too many special +cases... Devices without hostname, devices with same hostname, devices +switching from one network to another, devices with same hostname in +different network, ... + +Fixing one broke another. It never really worked without problems. So +finally the code ended with what we have now. + +I know about that side effect and limitation with reverse lookup, but +there's really no (easy) way to get that right without mac address. The +reverse lookup will always give a name based on mac address. + See also -------- From 65febff022f604b027f578e695c0b2f9c13da07f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Mar 2026 11:30:55 +0100 Subject: [PATCH 5/6] contrib/html: break the line --- contrib/html.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/html.sh b/contrib/html.sh index 03eba23d..8a573c2d 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -13,7 +13,8 @@ sed \ markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ -e '/| id="\L\1">|' \ - -e '//s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \ -e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|' From 8682e237c35e51869cd3598e8160e064c9b624ac Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Mar 2026 11:32:24 +0100 Subject: [PATCH 6/6] contrib/html: strip question mark from anchor --- contrib/html.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/html.sh b/contrib/html.sh index 8a573c2d..adacbbb8 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -15,6 +15,7 @@ markdown -f toc,idanchor "${1}" | sed \ -e '/| id="\L\1">|' \ -e '//s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \ -e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|'