DNS wiki example not work. Why?

Hi!

WIKI: https://wiki.mikrotik.com/wiki/Manual%3AIP/DNS#Notes

I am trying to test wiki example:
/ip dns static add name=“.*\.example\.com” address=“127.0.0.1” But i saw answer:
failure: bad nameWhat’s wrong?

instead of “name” use “regexp” if you are adding regexp.

Thank! It works fine.

This is seem to mistake in wiki page :frowning:

No need to include asterisk for hostname. Add $ to mark end of word:


/ip dns static
add address=127.0.0.1 regexp="\\.example\\.com\$"

@MT (if anyone is reading this), another example of why allowing static 0.0.0.0 and :: values as (intended) invalid dns entries would be a good idea (web site blocking purposes).