I'm trying to run a nslookup by specifying the host IP as as follows:
Resolve-DnsName -Type A -TcpOnly -DnsOnly -NoHostsFile -QuickTimeout -Server $THIS_MACHINES_IP -Name $NAME_OF_SERVER
I get the following error when it runs:
An existing connection was forcibly closed by the remote host
The problem is that $THIS_MACHINES_IP
server is running in a restricted environment so only few ports are open. In this case I need to run it on port 7450
, i.e. $THIS_MACHINES_IP:7450
.
Does anyone know how I can provide the port number when using Resolve-DnsName
or alternative means to achieve the same?
Resolve-DnsName
doesn't allow changing the port. You could use nslookup
, though:
nslookup -port=7450 $NAME_OF_SERVER $THIS_MACHINES_IP
However, running a nameserver on any port other than 53 is not a good idea in the first place. I wouldn't recommend it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With