DNS resolver written in C using sockets