boilerplate c dns client code