title: Resolve-DnsName -Server on specific Port
body: <p>I'm trying to run a nslookup by specifying the host IP as as follows:</p>
  
  <pre><code>Resolve-DnsName -Type A -TcpOnly -DnsOnly -NoHostsFile -QuickTimeout -Server $THIS_MACHINES_IP -Name $NAME_OF_SERVER     
  </code></pre>
  
  <p>I get the following error when it runs:</p>
  
  <blockquote>
    <p>An existing connection was forcibly closed by the remote host</p>
  </blockquote>
  
  <p>The problem is that <code>$THIS_MACHINES_IP</code> server is running in a restricted environment so only few ports are open. In this case I need to run it on port <code>7450</code>, i.e. <code>$THIS_MACHINES_IP:7450</code>.</p>
  
  <p>Does anyone know how I can provide the port number when using <code>Resolve-DnsName</code> or alternative means to achieve the same?</p>