Page 1 of 1

DNS resolver

Posted: Fri Nov 02, 2007 4:55 am
by roadrunner
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.

Re: DNS resolver

Posted: Fri Nov 02, 2007 5:30 am
by Letni
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.

Re: DNS resolver

Posted: Sat Nov 03, 2007 5:17 am
by Equis
Make sure you have dns set :-)

Re: DNS resolver

Posted: Tue Nov 06, 2007 5:44 am
by iam8up
/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.

Re: DNS resolver

Posted: Tue Nov 06, 2007 10:35 am
by roadrunner
/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]

Re: DNS resolver

Posted: Tue Nov 06, 2007 3:42 pm
by jorj
: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. :)