match long domain name

I want to set up static dns in ros for matching any long (over 5 characters) subdomains
eg. I want to match any domain like xyzxyz.example.com or abcabcabc.example.com, but don’t want to match xyz.example.com or abcab.example.com.


I was using ^.*{6,}.example.com, but what I got in static record is unknown record, ip is 0.0.0.0

Why do you like to do that? An what to do if it match?

This is exactly one of the reason I would like DoH welcome. Noen of the ISP on the route to main DNS owner can not see nor alter my DNS request.

The reason I want to use it is for my NAS (unraid), which releases a new function in new version and needs DNS rebind to match a record for xxxxxx(radom ID, over 40 bit long).unraid.net, so I want have the match in my DNS static.

The next works:

^([a-z0-9]|[a-z0-9][a-z0-9]|[a-z0-9][a-z0-9][a-z0-9]|[a-z0-9][a-z0-9][a-z0-9][a-z0-9]|[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]).example.com

However I would have expected it to work with a {1,2,3,4,5}

Try this this one:

^[a-z0-9]{6,}\\.example\\.com\$



:put ("xyz.example.com" ~ "^[a-z0-9]{6,}\\.example\\.com\$") = false
:put ("xyzxyz.example.com" ~ "^[a-z0-9]{6,}\\.example\\.com\$") = true

You need extra "" when you are inside a string/text in RouterOS.
:put “$variable $ 100.00 for hundred dollars”

local variable 99; :put "$variable \$ 100.00 for hundred dollars"

It works only for scripts not for a static DNS regex.

Bummer, really limited.

Quick and dirty and matching any character number or sign

......\.example\.com$

Yours will match any subdomains with 1-6 characters. What I want is to match longer than 6 characters, like abcdefghijk.example.com



(........)+.unraid.net

Above works, thank you

You have use th "" because yous wiil also match

abcdefrunraid.net

Then using the “()” with the plussign will only match only multiples of the group.

So not abdcefg.unraid.net but it will match abcdefabcdef.unraid.net

Correct is:

.*......\.unraid\.net$

Thanks for your answer