Community discussions

MikroTik App
 
cata02
Member Candidate
Member Candidate
Topic Author
Posts: 116
Joined: Fri Mar 05, 2010 8:58 am

Regular expression for DNS Query

Tue Apr 12, 2011 11:52 am

Helo experts,

Does anyone have any ideea how to catch dns query packets, and not catch anything else?

thanks.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Regular expression for DNS Query

Wed Apr 13, 2011 12:31 pm

53/udp

what exactly do you need?
 
cata02
Member Candidate
Member Candidate
Topic Author
Posts: 116
Joined: Fri Mar 05, 2010 8:58 am

Re: Regular expression for DNS Query

Wed Apr 13, 2011 4:24 pm

i dont want to catch all dns protocol, only request (first flag bit = 0).

i want to properly cache dns, caching only request types, and not catch other dns packets (like a computer registering it's name).
 
cata02
Member Candidate
Member Candidate
Topic Author
Posts: 116
Joined: Fri Mar 05, 2010 8:58 am

Re: Regular expression for DNS Query

Wed Jul 20, 2011 8:36 pm

mikrotik guru's,

any idea?
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Regular expression for DNS Query

Wed Jul 20, 2011 8:46 pm

When you enable DNS caching in RouterOS, it will cache all queries made through the DNS protocol (port 53). However, you can search this cache if you need information from it:
/ip dns cache all find
 
cata02
Member Candidate
Member Candidate
Topic Author
Posts: 116
Joined: Fri Mar 05, 2010 8:58 am

Re: Regular expression for DNS Query

Wed Jul 20, 2011 9:04 pm

not exacly what i need.

if i use transparent dns proxy on that box it will catch both dns requests and other dns packets (like machine registrations).
If i catch other dns packets, my computers will not register in the main dns and most internal services (like active directory) will not work.

I was thinking about creating an nat rule that will transparently route dns packets, only if they are request type, and not anything else.
The closest thing that came to mind was L7 regex, but i dont know if it is possible to create an regex expression that will match on a bit-level information.

Is there any other solution?

Who is online

Users browsing this forum: GoogleOther [Bot], kormenator and 197 guests