Community discussions

MikroTik App
 
snoozer
Member Candidate
Member Candidate
Topic Author
Posts: 154
Joined: Mon Jun 18, 2007 5:13 pm
Location: Schull, West-Cork, Ireland.

DNS Wildcard in ROS

Wed Apr 13, 2011 12:39 pm

hello,

i am trying to implement a redirection to a website that tells a customer that we have currently an outage. i do that successfully with NAT and the proxy to show a pre defined html page with the info needed. this only works as long as i have DNS (in my test i have DNS cause i have no real outage) because the browser needs to get an ip address first to know where to connect to. if i do have a real outage and need to inform customers about this it wont work. i am trying to find a way to make a DNS on ROS (JUST for that situation) respond to ALL queries with a pre defined ip address. is that somehow possible ?

thanks
Jan
 
User avatar
omega-00
Forum Guru
Forum Guru
Posts: 1167
Joined: Sat Jun 06, 2009 4:54 am
Location: Australia
Contact:

Re: DNS Wildcard in ROS

Thu Apr 14, 2011 5:20 pm

Here's an example of an entry you can add to your static DNS cache:

/ip dns static
add address=X.X.X.X comment="" disabled=yes name=".*.com\$" ttl=30s

This was one I was playing around with to redirect any <something>.com domains to a test page, you should be able to modify for you own usage (it's using a basic regular expression).

I don't have the time to test right now but I imagine doing either just ".*" or ".*$" would work much the same way.
 
mabooshi
just joined
Posts: 4
Joined: Thu Nov 20, 2014 6:13 pm

Re: DNS Wildcard in ROS

Mon Jan 12, 2015 9:29 am

I checked it but doesn't work for me
 
arnisraido
just joined
Posts: 1
Joined: Thu Jul 16, 2020 9:36 am

Re: DNS Wildcard in ROS

Thu Jul 16, 2020 9:42 am

Update: be aware - using *.local or *.dev domains is not "easy", because of specification of them.
- *.dev will not be accessible from major WEB browsers without SSL (https://medium.engineering/use-a-dev-do ... 219778e6fd)
- *.local is primary resolved by mDNS so it will receive a huge delay (about ~5seconds) every time on Windows.

The best would be to use some .localdev or .myname suffixes.

Works for me. For
 *.local
hostnames
Using WebFig:

IP > DNS > Static > Add New

Image
Last edited by arnisraido on Thu Jul 16, 2020 11:55 am, edited 1 time in total.