Community discussions

MikroTik App
 
fbslim
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 61
Joined: Wed Feb 22, 2012 12:17 pm

DNS server on mikrotik with forwarding to LAN hosts

Wed Feb 22, 2012 12:46 pm

Hello!

Need some help.

I have one external internet IP on router Mikrotik. And i have one server in my local network with IP 192.168.1.250 (for example).
This is web server with sites that must be accessible from Internet.

I can do forwarding from external port 80 to internal LAN 192.168.1.250:80. But, what will i do if i will have 2 web servers in my LAN with different resourses?! Mode proxy in apache2 is not a good decision of the problem.

I need real DNS requests and answers from my lan servers to the Internet, i think. But, lan host has no real internet IPs.

Tried to make static dns to lan host in section Static (IP/DNS) for example:
Name: http://www.anyhost.net
Address: 192.168.1.250

And it works great on all LAN computers.

Next, i write my name server in configuration of my anyhost.net domain.

And from internet im trying to ping address http://www.anyhost.net and see IP - 192.168.1.250 :)

So this is working and resolving well, how it must be, but this is internal LAN ip.

I cant buy another external IP for each of my LAN web server. Need to work from on IP on Mikrotik router.


Is there any ways to solve this problem? Is there any people who can answer?
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: DNS server on mikrotik with forwarding to LAN hosts

Wed Feb 22, 2012 8:34 pm

You need reverse proxy. It's not possible to have only one external IP and forward one port to two internal servers at the same time.
 
fbslim
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 61
Joined: Wed Feb 22, 2012 12:17 pm

Re: DNS server on mikrotik with forwarding to LAN hosts

Wed Feb 22, 2012 9:13 pm

You need reverse proxy. It's not possible to have only one external IP and forward one port to two internal servers at the same time.
Yes, its possible! I saw linux host that working as Inet router for LAN with one real external IP and one LAN IP. In it /etc/hosts config was records on different domain placed on different LAN web servers. For example:

192.168.1.200 www.site1.com
192.168.1.222 www.site2.com

And this two sites can be resolving from internet, because this host has route from DNS on its real IP.

Why it doesnt work on Mikrotik?! Dont know... :(
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: DNS server on mikrotik with forwarding to LAN hosts

Wed Feb 22, 2012 9:52 pm

Too bad you didn't write down how it was done on that magic Linux router. ;)

I mean, really, when first packet comes to external IP to port which should be forwarded inside, it does not carry any info about requested domain name. But the router needs to forward it immediately, it can't wait until domain info comes. Even if it somehow could, something (the target server) must reply to client first, otherwise it won't continue. But there's no known target server yet.

Proxy on the other hand can start conversation with client, let it send requested domain and when it does, then ask the right server.

Who is online

Users browsing this forum: Bing [Bot], kevinlukas, mada3k, pe1chl, TheCat12 and 98 guests