Community discussions

MikroTik App
 
User avatar
greek
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Thu Nov 04, 2010 11:37 pm
Location: Russia, 78rus

DNS wiki example not work. Why?

Mon Jul 08, 2019 6:54 pm

Hi!

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

I am trying to test wiki example:

Code: Select all

/ip dns static add name=".*\\.example\\.com" address="127.0.0.1"
But i saw answer:

Code: Select all

failure: bad name
What's wrong?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: DNS wiki example not work. Why?

Mon Jul 08, 2019 7:02 pm

instead of "name" use "regexp" if you are adding regexp.
 
User avatar
greek
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Thu Nov 04, 2010 11:37 pm
Location: Russia, 78rus

Re: DNS wiki example not work. Why?

Mon Jul 08, 2019 7:17 pm

Thank! It works fine.

This is seem to mistake in wiki page :(
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: DNS wiki example not work. Why?

Mon Jul 08, 2019 7:18 pm

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).

Who is online

Users browsing this forum: litogorospe and 98 guests