I know that Dns methods are static and CancelAsync() is implemented on
object instances but how can i clean up the resources if time out occurs?

I personally expected somthing like this:

private static void GetHostEntryCallback(IAsyncResult ar)
{
Dns.EndGetHostEntry(ar);
...
getHostEntryFinished.Set();
}

private void buttonResolve_Click(object sender, EventArgs e)
{
...
if (getHostEntryFinished.WaitOne(30000, false))
{
...
}
else
Dns.CancelAsync();
...
}