Community discussions

MikroTik App
 
User avatar
SeaburyNorton
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Sep 28, 2010 9:39 pm

OpenDNS, strange behavior...

Fri Oct 08, 2010 8:00 am

Hello!

I had wanted to use openDNS as my dns servers, while all of my lan clients use the mikrotik router ip for their requests (caching). Here's the problem:

OpenDNS replies no matter what the hostname.

For instance, if I try to ping one client machine (behind a masquerade) from another, I get an incorrect response because it resolves the name from openDNS.

For instance,

behind the masquerade, machine "bill" tries to ping machine "jake," which are both on the same subnet. The dhcp is giving both clients the mikrotik router address as the dns server. The reply from openDns' intercept page comes back instead of the private internal address.

If any other DNS servers are used, this does not happen.

Any clues how to circumvent this?
 
reverged
Member Candidate
Member Candidate
Posts: 270
Joined: Thu Nov 12, 2009 8:30 am

Re: OpenDNS, strange behavior...

Fri Oct 08, 2010 9:15 am

If any other DNS servers are used, this does not happen.
Other public dns servers or other private dns servers?

If you have a limited number of machines, add static entries under /ip dns static.

Works for me.

You could also write a script that goes through the dhcp leases and extracts the active hostnames, adding them to the static dns table.
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: OpenDNS, strange behavior...

Fri Oct 08, 2010 9:24 am

This is the default for OpenDNS.

However, there is a solution: add dhcp leases to static dns in the router:
http://wiki.mikrotik.com/wiki/Setting_s ... DHCP_lease
 
User avatar
SeaburyNorton
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Sep 28, 2010 9:39 pm

Re: OpenDNS, strange behavior...

Fri Oct 08, 2010 6:37 pm

This is the default for OpenDNS.

However, there is a solution: add dhcp leases to static dns in the router:
http://wiki.mikrotik.com/wiki/Setting_s ... DHCP_lease


I think the second script on that page may help, I'm going to test it later! THANK YOU!

The page says to run this in scheduler. Do I need to run this at an interval or just once in total? Would I have to re-run it in the event of a router reboot?

I'm running ROS 4.1, and there's a "script" section... would that be a better place than scheduler?

Again, thank you.
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: OpenDNS, strange behavior...

Sat Oct 09, 2010 6:12 am

The scheduler basically just runs scripts at a certain interval. To insure the dns entries are consistent with dhcp leases, I would schedule it for any interval (say 5mins). If you reboot, this script still gets run every 5 mins so you should be ok there.

First thing, add the script to RouterOS: System -> Scripts
Then schedule the script: System -> Scheduler (set OnEvent to the name of the added script above).

Also, you can find more about scripting here:
Manual:Scripting

Hope this helps.
 
User avatar
SeaburyNorton
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Tue Sep 28, 2010 9:39 pm

Re: OpenDNS, strange behavior...

Sat Oct 09, 2010 11:18 pm

Thank you much! This worked a treat!

I used the second script on the page as I have manual entries as well that I didn't want disturbed. It uses the TTL difference to differentiate between the two types. Fantastic!
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: OpenDNS, strange behavior...

Sun Oct 10, 2010 5:51 am

Glad I could help :)

Who is online

Users browsing this forum: Fablos, rmenkveld and 55 guests