ngx_resolver.c, lines 590-592, shouldn't they read: if (!ngx_queue_empty(&r->name_resend_queue)) { ngx_add_timer(r->event, (ngx_msec_t) (r->resend_timeout * 1000)); } i.e. set the timer if the queue isn't empty?