Community discussions

MikroTik App
 
jjmuriel
just joined
Topic Author
Posts: 10
Joined: Sat Mar 25, 2017 5:49 am

Redirect external domain to another external domain (including subdomains)

Thu Dec 01, 2022 3:16 pm

Hi,
In Mikrotik, how can I redirect some external domain to another external domain, including subdomains? For example, when a host from the LAN try to navigate to xxxx.domain-one.org, the router redirects the request to xxxx.domain-two.org. And when another host try to navigate to yyyyy.domain-one.org the router redirects to yyyyyy.domain-two.org? NOTE: The router is the DNS server.
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Redirect external domain to another external domain (including subdomains)

Thu Dec 01, 2022 6:57 pm

It depends. If you mean redirect e.g http(s) requests, you can't. If you mean that client asks for IP address of xxxx.domain-one.org and gets address of xxxx.domain-two.org, you probably also can't, at least not easily and reliably. AFAIK there's no direct aliasing mechanism. If it was for specific hostnames (not all subdomains), you could add static records and use script to update them from time to time. But for anything not known in advance it's problematic. You could perhaps use another script to find new subdomains in cache and create static records for them, and then keep them updated by first script. But it would be ugly and unreliable (at least first request would always return wrong answer).

Edit: Or maybe CNAME record, but I don't know if router itself would handle it as you need (edit2: nope).

Who is online

Users browsing this forum: Bing [Bot], GoogleOther [Bot], jookraw, st3lios and 78 guests