Community discussions

MikroTik App
 
ashkan92
just joined
Topic Author
Posts: 4
Joined: Wed Jul 12, 2023 10:28 am

redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 10:42 am

Hi.
I have a Mikrotik RouterBoard in my local network. All I need is that every request to a specific subdomain (let's say sub.example.com) redirects to a local IP (for example 192.168.1.24) without any change in other requests.
I'd appreciate any response. :)
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 13060
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 11:26 am

What DNSs are set up on the other devices?
 
ashkan92
just joined
Topic Author
Posts: 4
Joined: Wed Jul 12, 2023 10:28 am

Re: redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 11:38 am

What DNSs are set up on the other devices?
Other devices haven't any DNS, our DNS server is the Mikrotik. However, maybe someone sets another DNS on his/her device.

Thank you for your response.🙏
Last edited by ashkan92 on Wed Jul 12, 2023 8:48 pm, edited 1 time in total.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13729
Joined: Thu Mar 03, 2016 10:23 pm

Re: redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 12:25 pm

Generally you need a proper reverse proxy (e.g. HAproxy, apache, etc.) to redirect requests per FQDN, ROS can not do it properly.
 
ashkan92
just joined
Topic Author
Posts: 4
Joined: Wed Jul 12, 2023 10:28 am

Re: redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 3:25 pm

Generally you need a proper reverse proxy (e.g. HAproxy, apache, etc.) to redirect requests per FQDN, ROS can not do it properly.
Thank you. Yes, there are many problems with redirecting with Mikrotik. I changed the plan to use another way.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13729
Joined: Thu Mar 03, 2016 10:23 pm

Re: redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 3:54 pm

Yes, there are many problems with redirecting with Mikrotik.
The only problem "with directing with Mikrotik" is that Mikrotik is a router and firewall and has thus very limited capabilities beyond L4 (i.e. handling UDP/TCP packets). And "redirecting a subdomain" is an L7 (because it has to interact with actual protocol, e.g. HTTPS), which is beyond the scope of Mikrotik.

Which means that the problem is rather with (too high) expectations of MT owner/admin.
 
ashkan92
just joined
Topic Author
Posts: 4
Joined: Wed Jul 12, 2023 10:28 am

Re: redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 8:47 pm

Yes, there are many problems with redirecting with Mikrotik.
The only problem "with directing with Mikrotik" is that Mikrotik is a router and firewall and has thus very limited capabilities beyond L4 (i.e. handling UDP/TCP packets). And "redirecting a subdomain" is an L7 (because it has to interact with actual protocol, e.g. HTTPS), which is beyond the scope of Mikrotik.

Which means that the problem is rather with (too high) expectations of MT owner/admin.
Oops! I'm not a network admin, and obviously I don't have the knowledge. I was trying to do a thing to help my own program work well but due to lack of knowledge or a pro person in the company, I failed and changed the way I'm doing a thing.🥲
Anyway, thank you for your response.🙏
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1613
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: redirect a subdomain to a private ip in the local network

Wed Jul 12, 2023 9:16 pm

<snip>
very limited capabilities beyond L4 (i.e. handling UDP/TCP packets). And "redirecting a subdomain" is an L7

What? You mean that whole OSI 7 layers thing actually means something? :D

Amazing how many people don't understand that...