I think this is what you need, i cant take full credit.. i just cut and pasted!
Its available as a library on my Git, https://github.com/Hootie81/DNSClient/blob/master/DNSClient/inc/myUDP.h
Add to your code:
#include "myUDP.h"
myUDP iUdp; //create an instance same as before but to myUDP