DNS Server with hourly request

For various reasons I need to set a DNS Server in several routers, but these routers have very expensive connections. For this reason I need a DNS Server that does several requests DNS (to five or six domains), store these IPs for one hour, in its DNS cache and at the next hour does another request.
Somebody could recommend me how to do this?


You should be able to configure Dnsmasq as a caching nameserver. Making sure the A Records in question have a TTL >= 3600 seconds should cover the rest.

See: https://wiki.openwrt.org/doc/uci/dhcp

But is not reccomended a TTL >3600seconds for DNSmasq


I don't understand your statement. No such recommendation is located at: https://wiki.openwrt.org/doc/uci/dhcp

Global DNS A records can have any valid TTL value, including values greater than 3600 seconds (one hour). To setup your system, simply increase the "cache-size" value in Dnsmasq and make sure any A Record you need to cache has a TTL >=3600 seconds.

Also see: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

and: https://www.techrepublic.com/article/how-to-speed-up-dns-caching-on-your-linux-machines-with-dnsmasq/

An older common TTL value for DNS was 86400 seconds, which is 24 hours. A TTL value of 86400 would mean that, if a DNS record was changed on the authoritative nameserver, DNS servers around the world could still be showing the old value from their cache for up to 24 hours after the last update by the client. Newer DNS methods that are part of a disaster recovery (DR) system may have some records deliberately set extremely low on TTL. Look what is TTL and how it works. For example, a 300-second TTL would help key records expire in 5 minutes to help ensure these records are flushed quickly worldwide. Time to live (TTL) or hop limit is a mechanism that limits the lifespan or lifetime of data in a computer or network, you know?) and it could be always stable.