Community discussions

MikroTik App
 
imagineerBurky
just joined
Topic Author
Posts: 8
Joined: Wed Nov 06, 2013 2:23 am
Location: Ann Arbor, Michigan USA

Static DNS only works intermittently

Sat Nov 09, 2013 2:56 pm

The static DNS entries on my MikroTik LAN routers only seem to work for a day or two, then quit resolving and act is if they are not there at all.

This is a two layer system, set up as follows ...

ISP >> router1 >(WLAN)> router2 >(LAN)> web server

The web servers located on the 'web server' object above, are used by users both on the LAN served by router2, and from outside via the web. There are three separate servers running on the web server each delivering different functions.

So that users can reach the 'web server' from anywhere on/off the LAN, NAT forwarding is configured on both routers 1 and 2.

To access a server from outside the construct would be "mysite.org:1001" or "mysite.org:1002", etc.

The NAT table in router1 redirects port 1001 to router2 where it is then NATed to web server IP:port 1001

Router2 then has a static DNS entry for "mysite.org" which resolves LAN originated requests back to the web server IP. Thus on/off LAN accesses always resolve to the server IP and correct port (well when it works, that is).

Normally this all works fine, but when it fails every other day or so, browsing to "mysite.org:1001" results in a "Chrome could not connect to mysite.org". Pinging that URL results in "Ping request could not find host mysite.org:1001"

BUT browsing from the LAN to "mysite.org" (without a port number) resolves to the web interface on port 80 of router1, and pinging that URL resolves to the public IP address of everything.

There are no changes made to the router at all, this just happens spontaneously. When I reboot the routers it seems to recover and work for another day, then quits again.

Router2 has DHCP is enabled for the LAN and all Leases in the DHCP Server-Leases table are stable and Bound.

I am at wits end trying to figure out what is (self) changing in one of the routers to cause this issue. Looking over all parameter settings I think should havean impact show no changes at all from normal.

Any thoughts or ideas will be GREATLY appreciated. :?
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Static DNS only works intermittently

Sat Nov 09, 2013 3:30 pm

Are the dhcp clients looking at the router dns? When this happens take a look at the cache of the router dns. In the cache you should find your static entry. If the entry is there then your machines are not requesting your router dns, but some other dns server, I guess.
 
imagineerBurky
just joined
Topic Author
Posts: 8
Joined: Wed Nov 06, 2013 2:23 am
Location: Ann Arbor, Michigan USA

Re: Static DNS only works intermittently

Sat Nov 09, 2013 3:49 pm

Toni-

Thanks for the quick response! :D

Yes, all computer LAN adapters point to my 'router2' at 192.168.1.1 as the primary DNS service.

Router2 does contain the 'mysite.org' static entry in the DNS cache.

After discovering that even a router reboot did not cure the problem this time, I just installed Router OS6.6 and did a bootloader update.

All is working well again. Time will tell if that was the difference. The router had OS 5.5 installed on it, so this is a significant upgrade improvement, I hope.
 
imagineerBurky
just joined
Topic Author
Posts: 8
Joined: Wed Nov 06, 2013 2:23 am
Location: Ann Arbor, Michigan USA

Re: Static DNS only works intermittently

Tue Nov 12, 2013 3:22 pm

This gets more bizarre by the day! After upgrading the RB751U-2HnD router from OS 5.5 to 6.6, the random local static DNS resolution issues disappeared for several days, but this morning they are back, but different.

Now "mysite.org" always resolves but "mysite.org:1001" quit resolving although it did fine just minutes before then stopped (with absolutely no chanages made anywhere by me).

Also 3 of 4 subdomains work fine but "prchcam.mysite.org" all of a sudden is failing and both Chrome and IE report they cannot find "torchcam.mysite.org" Where the "torch" rather than "prch" came from is really puzzling

Pinging "mysite.org" resolves, not to 192.168.1.90 as it should, but to the GoDaddy DNS record site of 50.63.202.24. Pinging "mysite.org:1001" resolves to "Ping request could not find host mysite.org:1001"

Pinging "prchcam.mysite.org" resolves not to 192.168.1.43 as it should but to the GoDaddy DNS record site of 50.63.202.24

Pinging any other subdomain such as "drvcam.mysite.org" correctly resolves to 192.168.1.41, as it should.

Looking at the DNS Cache entries in the router for good/failed URLs they are identical except for the target addresses, which are accurate as they should be.

The router correctly contains both a "mysite.org" and a "prchcam.mysite.org" static DNS record correctly flagged with "S" (static) flags and "A" type records..

This has me totally puzzled. As far as I can tell it all originates in the RB751U-2HnD router, but at a loss as to how to proceed further.

Any thoughts, ideas, suggestions would be GREATLY appreciated !!! :?

HELP !!!!!!!!!!!!!
 
imagineerBurky
just joined
Topic Author
Posts: 8
Joined: Wed Nov 06, 2013 2:23 am
Location: Ann Arbor, Michigan USA

Re: Static DNS only works intermittently

Tue Nov 12, 2013 3:29 pm

Post Script to above comments.

I just attempted to access "prchcam.mysite.org:1043" from my iPhone on the LAN and it works, but the same URL from my PC fails with a "torchcam.mysite.org:1043" failure !!!!!

It would thus appear that the PC is the source of this confusion and not the router.

What in the heck on the PC is a common element that would cause pings and Chrome and IE browser failures?
:roll:
 
imagineerBurky
just joined
Topic Author
Posts: 8
Joined: Wed Nov 06, 2013 2:23 am
Location: Ann Arbor, Michigan USA

Re: Static DNS only works intermittently

Tue Nov 12, 2013 4:01 pm

Post Post Script -

I've discovered that if I /release then /renew my computer DHCP Lease that things work again for everything!

Even the weird "prch" to "torch" corruption is fixed.

Can anyone share a thought about what might be going on? :shock:
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Static DNS only works intermittently

Tue Nov 12, 2013 6:38 pm

I guess, mostly I am sure, that the PC is looking at some other DNS server and not the one on the router. What is causing it I don't know, could be a virus alternating the dns servers or redirecting those requests. As a solution I would propose to set up a transparent dns redirect on your router:
/ip firewall nat
add chain=dstnat protocol=tcp dst-port=53 action=redirect to-ports=53
add chain=dstnat protocol=udp dst-port=53 action=redirect to-ports=53 
At this point you need to protect your router from outside dns requests
/ip firewall filter
add chain=input in-interface="your internet interface" protocol=tcp dst-port=53 action=drop
add chain=input in-interface="your internet interface" protocol=tcp dst-port=53 action=drop
Obviously the dns server on your router must be set to accept requests.
 
imagineerBurky
just joined
Topic Author
Posts: 8
Joined: Wed Nov 06, 2013 2:23 am
Location: Ann Arbor, Michigan USA

Re: Static DNS only works intermittently

Tue Nov 12, 2013 7:14 pm

Tony-

Thank you for the feedback and effort.

I think with the help from another IP friend that I may have found it.

On both the "DNS Settings" and the "DHCP Settings" tables in the MikroTik I had multiple (identical in each table)entries for DNS Servers.

They all lead off with a 1st reference back to the router itself at 192.168.1.1.

My associate indicated he had seen prior issues when the primary DNS Setting pointed back to the router itself and the DHCP Network table had anything else in it but a DNS Servers pointer back to the router (192.168.1.1)

Accordingly I changed everything so that the DNS Settings table only has external addresses and the DHCP Network DNS Servers section has only a single entry pointing to the router itself at 192.168.1.1

So far so good. Everything is currently working correctly as desired.

Now just have to wait and see if it holds for more than a day or two. :-?

Who is online

Users browsing this forum: Deantwo, Google [Bot], gtsspmsbr, jaclaz, jason9456402, nagylzs and 119 guests