some questions about bind9

蒋雄伟(蒋冲) xiongwei.jiang at
Thu Oct 22 01:40:05 UTC 2015

Recently I begin to read source code of bind9. I am puzzled by following

a)       I found that the call trace is : load_configuration à
scan_interfaces à ns_interfacemgr_scan à ns_interfacemgr_scan0 à do_scan
à ns_interface_setup à ns_interface_listenudp à dns_dispatch_getudp_dup
à dispatch_createudp à get_udpsocket à open_socket, then finally perform
systemcall socket and bind.  But I don’t find when and how these sock->fd
are added to epoll? 

b)       I only find manager->fds[0] is added to epoll when setup_watcher().
It seems that someone can call select_poke to trigger watcher thread to
watch_fd. But ,by far , created fds are not added to epoll , how is udp
packet received? Who will call select_poke()?

c)        What does dns_dispatch do ? why multi dns_dispatch are created for
one interface?

d)       What does timermgr and all kinds of timer do ?


I am extremely anxious to find the answer, your reply are highly



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bind-workers mailing list