Community discussions

MikroTik App
 
skynoc
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Wed Jul 07, 2004 10:20 pm
Contact:

dns script

Thu Mar 08, 2007 2:16 pm

hi guys
anyone can help me with a script copy all the sites from the dns cache and adds it to dns static ?
thank you
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Thu Mar 08, 2007 5:37 pm

Something like
:foreach a in=[/ip dns cache find static=no] do={
  /ip dns static add address=[/ip dns cache get $a address] name=[/ip dns cache get $a name]
}
should add all entries from the cache that not already are static to the static list...

Not really tested, the usual warnings apply ;-)

Best regards,
Christian Meis
 
skynoc
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Wed Jul 07, 2004 10:20 pm
Contact:

Thu Mar 08, 2007 6:29 pm

hi christian ,
thank you for the script
it really works

regards
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Fri Mar 09, 2007 9:29 am

Hi cmit

1- Could you ensure the static DNS will faster than the dynamic?

2- Where the static DNS address save in MT?

Dose it save in memory?
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Fri Mar 09, 2007 2:44 pm

to 2 - they should be saved on your flash/harddisk (so they will be there after a reboot)

to 1 - I'm not sure I understood what you meant. If there IS a static entry, the DNS service will ONLY ever answer with that static entry. Or what do you mean by "faster"?

Best regards,
Christian Meis
 
dawam
Trainer
Trainer
Posts: 134
Joined: Wed May 31, 2006 1:40 pm
Location: Malaysia

Sat Mar 10, 2007 12:00 am

cmit,

If I could understand it and would like to learn from the experts.

Why do you need to put the dns cache into static list ? Is there a good reason for this ?

Does this mean the static list is lookup first then only the cache

Thanks,
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Sat Mar 10, 2007 9:42 pm

Actually I don't know why ;)
I just produced the script he asked for ...

Best regards,
Christian Meis
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Sat Mar 10, 2007 9:42 pm

Actually I don't know why ;)
I just produced the script he asked for ...

Best regards,
Christian Meis
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Sun Mar 11, 2007 7:45 pm

cmit

Thank you for your answer.

What I meaning is that after I make the dynamic DNS cache ip to static ip in my MT, it would make my NAT speed faster than befor?

HTTP require---> MT --->DNS resolve the web site to IP---->MT NAT the require to target IP.

Such as http://www.abc.com =1.2.3.4
when I first access it, DNS will tracert it from internet and get the real ip of web site
But I can make it as the static IP in my MT

So my question is : after I made it, would it faster than dynamic DNS tracert?
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Sun Mar 11, 2007 7:46 pm

Thank you for your answer.

What I meaning is that after I make the dynamic DNS cache ip to static ip in my MT, it would make my NAT speed faster than befor?

HTTP require---> MT --->DNS resolve the web site to IP---->MT NAT the require to target IP.

Such as http://www.abc.com =1.2.3.4
when I first access it, DNS will tracert it from internet and get the real ip of web site
But I can make it as the static IP in my MT

So my question is : after I made it, would it faster than dynamic DNS tracert?
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Mon Mar 12, 2007 9:25 am

First, DNS requests aren't answered by doing a "dns tracert", but by DNS queries. This would only have a SMALL benefit after rebooting, when the dynamic dns cache is empty.
When the dns name is resolved once, it's put into the static cache. From then on (until a reboot - the dynamic cache is held in RAM only - or a manual cache clear) resolving speed will be the same for static and/or dynamic dns entries.

Best regards,
Christian Meis
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: dns script

Wed Nov 29, 2017 11:18 pm

...
Last edited by ADahi on Wed Dec 20, 2017 1:22 pm, edited 3 times in total.
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: dns script

Wed Dec 13, 2017 8:32 pm

how to add scripts to wiki?
 
msatter
Forum Guru
Forum Guru
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: dns script

Wed Dec 13, 2017 10:21 pm

Say pretty please. And hope the maintainer of the Wiki notice it.

Who is online

Users browsing this forum: No registered users and 28 guests