Score:0

Bind9 - cache all forwarded queries for a while

cg flag

My servers was keep asking similar dns queries to 8.8.8.8 and it cost around 30 ms every time. So that I have installed a Bind server and forwarded all dns requests to 8.8.8.8 like this:

zone "." IN {
       type forward;
       forward first;
       forwarders { 8.8.8.8; };
};

Everything works but I have a problem with caching. my aim is caching queries' answer like 1 hours.

desired scenario:

-let's say a server send a dns query for google.com

-my bind server forward it to 8.8.8.8 and returns a response and cache it.

-same server or another server send dns request to google.com in 1 hour.

-this time bind dns server don't forward it to 8.8.8.8, instead , return answer from its own cache. In that way my servers won't lose time to go 8.8.8.8 again and again.

current situation:

-each server gets a response within 30ms on the first query.

-When I send a query again, it returns answers 0 ms. It is probably returning from the local cache on the server.

-but after 1-2 minutes, when I send a query from the same server, the response is still over 30 ms.

-also if I send same dns query(let's say google.com) from 4 different servers in the same seconds, still all servers forwards to 8.8.8.8 and answers come from remote dns servers, not my local cache

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.