dns-cache.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. DNS caching
  2. ===========
  3. User experience may be greatly improved when dns is accelerated. Also, it
  4. seems like a good idea to keep the number of packages being exchanged
  5. between node and gateway as small as possible. In order to do this, a
  6. DNS cache may be used on a node. The dnsmasq instance listening on port
  7. 53 on the node will be reconfigured to answer requests, use a list of
  8. upstream servers and a specific cache size if the options listed below are
  9. added to site.conf. Upstream servers are the DNS servers which are normally
  10. used by the nodes to resolve hostnames (e.g. gateways/supernodes).
  11. There are the following settings:
  12. servers
  13. cacheentries
  14. To use the node's DNS server, both options should be set. The node will cache at
  15. most 'cacheentries' many DNS records in RAM. The 'servers' list will be used to
  16. resolve the received DNS queries if the request cannot be answered from
  17. cache. Gateways should announce the "next node" address via DHCP and RDNSS (if
  18. any). Note that not setting 'servers' here will lead to DNS not working: Once
  19. the gateways all announce the "next node" address for DNS, there is no way for
  20. nodes to automatically determine DNS servers. They have to be baked into the
  21. firmware.
  22. If these settings do not exist, the cache is not initialized and RAM usage will
  23. not increase.
  24. When next_node.name is set, an A record and an AAAA record for the
  25. next-node IP address are placed in the dnsmasq configuration. This means that the content
  26. of next_node.name may be resolved even without upstream connectivity. It is suggested to use
  27. the same name as the DNS server provides: e.g nextnode.yourdomain.net (This way the name also
  28. works if client uses static DNS Servers). Hint: If next_node.name does not contain a dot some
  29. browsers would open the searchpage instead.
  30. ::
  31. dns = {
  32. cacheentries = 5000,
  33. servers = { '2001:db8::1', },
  34. },
  35. next_node = {
  36. name = 'nextnode.yourdomain.net',
  37. ip6 = '2001:db8:8::1',
  38. ip4 = '198.51.100.1',
  39. }
  40. The cache will be initialized during startup.
  41. Each cache entry will occupy about 90 bytes of RAM.