• MikroTik.com
  • RouterBOARD
  • User Meeting
  • Training
  • User Manual
  • Support
  • Downloads
  • Videos
Register |   * Login | HOME

View unanswered posts | View active topics

DNS server on mikrotik with forwarding to LAN hosts  Page 1 of 1
 [ 4 posts ]  Post new topic Reply to topic
  Print view Previous topic | Next topic 
Author Message
fbslim
 Post subject: DNS server on mikrotik with forwarding to LAN hosts
PostPosted: Wed Feb 22, 2012 12:46 pm 
Offline
just joined

Joined: Wed Feb 22, 2012 12:17 pm
Posts: 3
Karma: 0
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?


Top
 Profile  
 
Sob
 Post subject: Re: DNS server on mikrotik with forwarding to LAN hosts
PostPosted: Wed Feb 22, 2012 8:34 pm 
Offline
Member Candidate
Member Candidate

Joined: Mon Apr 20, 2009 8:11 pm
Posts: 195
Karma: 20
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.


Top
 Profile  
 
fbslim
 Post subject: Re: DNS server on mikrotik with forwarding to LAN hosts
PostPosted: Wed Feb 22, 2012 9:13 pm 
Offline
just joined

Joined: Wed Feb 22, 2012 12:17 pm
Posts: 3
Karma: 0
Sob wrote:
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... :(


Top
 Profile  
 
Sob
 Post subject: Re: DNS server on mikrotik with forwarding to LAN hosts
PostPosted: Wed Feb 22, 2012 9:52 pm 
Offline
Member Candidate
Member Candidate

Joined: Mon Apr 20, 2009 8:11 pm
Posts: 195
Karma: 20
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 4 posts ] 

Board index » RouterOS » General

All times are UTC + 2 hours


Who is online

Users browsing this forum: Bing [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Karma functions powered by Karma MOD © 2007, 2009 m157y