Community discussions

MikroTik App
 
bematft
just joined
Topic Author
Posts: 22
Joined: Mon Mar 04, 2013 9:17 am
Location: Hungary

DNS from way of internet

Sat Jan 26, 2019 5:25 pm

Hy there!

RB433AH -
I have two web server in my network...
Their FQDN registered in a domain provider. Let say example.com... The subdomains are web1.example.com and web2.example.com... Both of them forwarded to my network public ip address by me in ISP manager of my provider.
In /ip/DNS as static regisetered (and work fine from local network area)
web1.example.com - 10.0.0.1
web2.example.com - 10.0.0.2

While I have one web server, it worked fine. I need to redirekt in my network branch.
Before this, I used IP/Firewall/Nat 80 port to 10.0.0.1 server. While it was single.

Now with two servers: If the Nat rule enabled then both FQDN (web1 and web2) address redirect to 10.0.0.1 server (the original).
If the Nat rule disabled then neither FQDN can not find server. HTTP error 503.

I think it did not get rout from my DNS in the first case either, just use the NAT routing.

Any idea..?
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: DNS from way of internet

Sat Jan 26, 2019 5:47 pm

Yes, that is working as per design.

The public DNS will tell the world what address to use to get to your network. The router on your network edge then translates this to for port 80 in this case to your internal web server address as per the NAT rule you configured.

So that is all the router knows about, so if there are 2 servers, it will only do as per the NAT rule you configured and send to one. It will not help adding another NAT rule for Port 80, as that will just confuse the router as to which port 80 packet it should send to which web server.

So your options are to use 2 different port numbers, or get an additional public IP for the 2nd web server and assign NAT translation to this for 2nd web server
 
bematft
just joined
Topic Author
Posts: 22
Joined: Mon Mar 04, 2013 9:17 am
Location: Hungary

Re: DNS from way of internet

Sat Jan 26, 2019 5:59 pm

Thanks!

Could it work? :
I use two different port between the domain provider and mikrotik. forexample 81 port for the web1 and 82 for th web2... after then I'll set it up in the nat. 81 -> 10.0.0.1:80 && 82-> 10.0.0.2:80
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: DNS from way of internet

Sat Jan 26, 2019 7:41 pm

I have not worked in detail on DNS servers for a good couple of years now, (+- 10), but IIRC do not think you can specify port numbers in DNS.

Think you will have to enter the 2nd port number i.e. 81 as part of the URL e.e. http://www.yourdnsrecord.sub-domain.domain:81
Last edited by CZFan on Sat Jan 26, 2019 7:51 pm, edited 1 time in total.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12999
Joined: Thu Mar 03, 2016 10:23 pm

Re: DNS from way of internet

Sat Jan 26, 2019 7:49 pm

This could work ... but use of non-standard ports is awkward and there are (corporate) firewalls that block outward connections to non-standard ports, so clients from such networks won't be able to access your services.
With additional limitation put forward by @CZFan.

There's another possibility, available mainly for http and https: named virtual server. Two server (domain) names actually point to same server IP address and clients in the connection setup stage state name of server they're connecting to. Server then serves appropriate content (e.g. correct company's web page).

Who is online

Users browsing this forum: AmericanoDan and 18 guests