title: WCF Discovery finds endpoint but host is "localhost"
body: <p>I am trying to use the Discovery feature in WCF using <a href="http://msdn.microsoft.com/en-us/library/dd456783(v=VS.100).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/dd456783(v=VS.100).aspx</a> as a starting point. It works fine on my machine, but then I wanted to run the service on a different machine. The service was discovered properly but the hostname of the found service is always "localhost" which is of course not much use. </p>
  
  <h2>Service Endpoint:</h2>
  
  <pre><code>var endpointAddress = new EndpointAddress(new UriBuilder { Scheme = Uri.UriSchemeNetTcp, Port = port}.Uri);
  var endpoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(IServiceInterface)), new NetTcpBinding (), endpointAddress);
  </code></pre>
  
  <h2>Client:</h2>
  
  <pre><code>static EndpointAddress FindServiceAddress&lt;T&gt;()
  {
    Stopwatch stopwatch = new Stopwatch();
    stopwatch.Start();
    DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
    // Find  endpoints            
    FindResponse findResponse = discoveryClient.Find(new FindCriteria(typeof(T)));
    Console.WriteLine(string.Format("Searched for {0} seconds. Found {1} Endpoint(s).",stopwatch.ElapsedMilliseconds / 1000,findResponse.Endpoints.Count));
    if (findResponse.Endpoints.Count &gt; 0)
    {
       return findResponse.Endpoints[0].Address;
    }
    return null;
   }
  </code></pre>
  
  <p>Should I simply set the Host to System.Environment.MachineName?</p>