The remote host could not be resolved:
<p>I have the following C# program:</p>

<pre>
<code>using System;
using System.IO;
using System.Net;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string sourceUri = "http://tinyurl.com/22m56h9";

            var request = WebRequest.Create(sourceUri);
            try
            {
                //Edit: request = WebRequest.Create(sourceUri);
                request.Method = "HEAD";

                var response = request.GetResponse();
                if (response != null)
                {
                    Console.WriteLine(request.GetResponse().ResponseUri);
                }
            }
            catch (Exception exception) {
                Console.WriteLine(exception.Message);                
            }
            Console.Read();
        }
    }    
}
</code>
</pre>

<p>If a run my program, with the sourceUri = "http://tinyurl.com/22m56h9" everithing is OK, i just get the destination of the tinyurl link.<br>
But if a run my program with tinyurl link that redirects to a site that is marked as malware, my code throws an exception saying <code>The remote host could not be resolved: '...'</code>.  I need to get the uri of the malware link, because i want to make an application that search some test for link and returns if they are malware or not, and if a link is minified (the case above), i need to know where is redirecting to.</p>

<p>So my question is Am i doing something wrong in my code? or Is there a better aproach on testing if a link is a redirect or not? 
Thank in advance  </p>
