Wildcard static domain in Mikrotik

Hi Folks...

I jus't want to share how to create a wildcard static domain in mikrotik..
maybe you already knows about this link.. https://wiki.mikrotik.com/wiki/Manual:IP/DNS
that's wrote..


" Reverse DNS lookup (Address to Name) of the regular expression entries is not possible. You can, however, add an additional plain record with the same IP address and specify some name for it.
Remember that the meaning of a dot (.) in regular expressions is any character, so the expression should be escaped properly. For example, if you need to match anything within example.com domain but not all the domains that just end with example.com, like www.another-example.com, use name=".*\\.example\\.com"
Regular expression matching is significantly slower than of the plain entries, so it is advised to minimize the number of regular expression rules and optimize the expressions themselves. Example
To add a static DNS entry for www.example.com to be resolved to 10.0.0.1 IP address:
[admin@MikroTik] ip dns static> add name=www.example.com address=10.0.0.1
[admin@MikroTik] ip dns static> print
Flags: D - dynamic, X - disabled, R - regexp
 #     NAME               ADDRESS                                 TTL
 0     www.example.com    10.0.0.1                                1d
[admin@MikroTik] ip dns static>

Or use regex to match DNS requests:
[admin@MikroTik] ip dns static> add regexp="[*example*]" address=10.0.0.2
For more information how to use regex, read wiki page below.
https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions

but i'ts not working for me...
even when i using regex like "[*domain*]" my dns network suddenly error.. :D,
after I browsing sana sini :D,  I finally found some solution..
to create a wildcard dns in mikrotik, type your dns regex like this..



.+\.domain\.dev

That's it..
keep calm and wildcard on..

0 komentar:

Post a Comment