hold <status> <period>
Defines <period> during which the last name resolution should be kept based
on last resolution <status>
- <status> : last name resolution status. Only "valid" is accepted for now.
+ <status> : last name resolution status. Acceptable values are "nx",
+ "other", "refused", "timeout", "valid".
<period> : interval between two successive name resolution when the last
answer was in <status>. It follows the HAProxy time format.
<period> is in milliseconds by default.
- Default value is 10s for "valid".
+ Default value is 10s for "valid" and 30s for others.
Note: since the name resolution is triggered by the health checks, a new
resolution is triggered after <period> modulo the <inter> parameter of
nameserver dns2 10.0.0.2:53
resolve_retries 3
timeout retry 1s
+ hold other 30s
+ hold refused 30s
+ hold nx 30s
+ hold timeout 30s
hold valid 10s
} timeout;
struct { /* time to hold current data when */
int valid; /* a response is valid */
+ int nx; /* a response doesn't exist */
+ int timeout; /* no answer was delivered */
+ int refused; /* dns server refused to answer */
+ int other; /* other dns response errors */
} hold;
struct task *t; /* timeout management */
struct list curr_resolution; /* current running resolutions */
curr_resolvers->conf.line = linenum;
curr_resolvers->id = strdup(args[1]);
curr_resolvers->query_ids = EB_ROOT;
+ /* default hold period for nx, other, refuse and timeout is 30s */
+ curr_resolvers->hold.nx = 30000;
+ curr_resolvers->hold.other = 30000;
+ curr_resolvers->hold.refused = 30000;
+ curr_resolvers->hold.timeout = 30000;
/* default hold period for valid is 10s */
curr_resolvers->hold.valid = 10000;
curr_resolvers->timeout.retry = 1000;
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- if (strcmp(args[1], "valid") == 0)
+ if (strcmp(args[1], "nx") == 0)
+ curr_resolvers->hold.nx = time;
+ else if (strcmp(args[1], "other") == 0)
+ curr_resolvers->hold.other = time;
+ else if (strcmp(args[1], "refused") == 0)
+ curr_resolvers->hold.refused = time;
+ else if (strcmp(args[1], "timeout") == 0)
+ curr_resolvers->hold.timeout = time;
+ else if (strcmp(args[1], "valid") == 0)
curr_resolvers->hold.valid = time;
else {
- Alert("parsing [%s:%d] : '%s' unknown <event>: '%s', expects 'valid'\n",
- file, linenum, args[0], args[1]);
+ Alert("parsing [%s:%d] : '%s' unknown <event>: '%s', expects either 'nx', 'timeout', 'valid', or 'other'.\n",
+ file, linenum, args[0], args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}