Community discussions

MikroTik App
 
User avatar
roadrunner
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Thu May 18, 2006 11:22 pm
Location: US

DNS resolver

Fri Nov 02, 2007 4:55 am

Can you use domain names in ping commands or in the sntp/ntp client?

I want to be able to do a command like this:
'ping http://www.google.com' instead of 'ping 74.125.19.99'

Also I would like to specify the NTP server as ntp.isp.net instead of by IP.
Or use 0.pool.ntp.org, 1.pool.ntp.org & 2.pool.ntp.org for ntp servers.
 
User avatar
Letni
Member
Member
Posts: 376
Joined: Tue Dec 05, 2006 5:16 am
Location: South Carolina

Re: DNS resolver

Fri Nov 02, 2007 5:30 am

to ping a hostname you can do this
/ping [:resolve http://www.google.com]

And for keeping the NTP servers updated. Create a script with this in it.

/system ntp client set primary-ntp=[:resolve 0.pool.ntp.org]
/system ntp client set secondary-ntp=[:resolve 1.pool.ntp.org]

and schedule it to run however often you would like to change or update your NTP servers.
 
User avatar
Equis
Forum Veteran
Forum Veteran
Posts: 886
Joined: Mon Jun 06, 2005 6:48 am

Re: DNS resolver

Sat Nov 03, 2007 5:17 am

Make sure you have dns set :-)
 
iam8up
Member
Member
Posts: 333
Joined: Sun Oct 28, 2007 10:58 pm
Location: Troy, OH
Contact:

Re: DNS resolver

Tue Nov 06, 2007 5:44 am

/ip dns set primary-dns=1.1.1.1

/ip dns set secondary-dns=1.1.1.1
Make sure you set the correct IP addresses!
/system ntp client print 

enabled: yes
mode: unicast
primary-ntp: 192.5.41.41
secondary-ntp: 129.6.15.28
status: started
The primary is Tock, a US NAVY server and the scondary is a NIST server. Most of the routers we've deployed simply use 192.5.41.41.
 
User avatar
roadrunner
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Thu May 18, 2006 11:22 pm
Location: US

Re: DNS resolver

Tue Nov 06, 2007 10:35 am

/ip dns set primary-dns=1.1.1.1

/ip dns set secondary-dns=1.1.1.1
Make sure you set the correct IP addresses!
Why setup dns at all? The only time I see DNS being used by the router is when it is being a proxy server or the DHCP service retrieves those settings to hand out. But if you are unable to use a domain name in settings and you aren't using proxy or DHCP on that router, what is the point of setting it up in the first place?
/system ntp client print 

enabled: yes
mode: unicast
primary-ntp: 192.5.41.41
secondary-ntp: 129.6.15.28
status: started
The primary is Tock, a US NAVY server and the scondary is a NIST server. Most of the routers we've deployed simply use 192.5.41.41.
You should avoid using public stratum 1 time servers from all your routers directly.

tock.usno.navy.mil
time-a.nist.gov

The suggested configuration is to have 1 or 2 time servers on your network that tracks the time from servers like that and the rest of your machines on your network use your own time servers for reference.

Or use the NTP Pool Project which was started in 2003 as a response to the rapidly increasing resource consumption at the popular NTP servers and the problem of these servers then closing their operations.

I currently run two time servers that all my routers and servers use. The first one has been running since July 2002 and has about 6-7 good public servers, including tock.usno.navy.mil & time-b.nist.gov. The second server is newer and uses 0.us.pool.ntp.org,1.us.pool.ntp.org & 2.us.pool.ntp.org. But I am currently planning a change in my network that will be including a re-numbering of some servers and would like to not have to reconfigure the IP addresses everywhere, so I might try Lenti's suggestion:
/system ntp client set primary-ntp=[:resolve 0.pool.ntp.org]
/system ntp client set secondary-ntp=[:resolve 1.pool.ntp.org]
 
User avatar
jorj
Member
Member
Posts: 397
Joined: Mon Mar 12, 2007 4:34 pm
Location: /dev/null

Re: DNS resolver

Tue Nov 06, 2007 3:42 pm

:idea:

There is another way, wich might get you to "closer" time servers:
eg:

0.europe.pool.ntp.org
0.asia.pool.ntp.org.

See ntp.org for more.

And, if you don't need DNS and you set it in the router, it won't be used. :)

Who is online

Users browsing this forum: Amazon [Bot], intania, jmszuch1, mflorin and 39 guests