Telnet - Connection refused when using hostname, connects fine with IP
Well, the output of nslookup myserver
suggests (a) that you're resolving DNS queries at myserver/123.4.5.6, and (b) that its database doesn't contain a record for its own dns name. This would explain why telnet fails but not why ping works.
On a Windows machine I would try appending a literal dot to all DNS names just to make sure they're treated as absolute ones and no suffixes are added by the Windows API. After all, ping and telnet may call the API in different ways.
Finally, your ipconfig
listing doesn't help much because IP addresses in it do not correspond to the ones in other listings. Please, update it.
Related videos on Youtube
NightWolf
Updated on September 18, 2022Comments
-
NightWolf almost 2 years
I'm trying to connect to a telnet server from a windows 7 machine. The telnet server has an IP
123.4.5.6
and a hostname ofmyserver
Running
telnet 123.4.5.6 8080
works fineHowever when I try to use the server's hostname it fails to connect;
telnet myserver 8080
fails. Yet aping myserver
gives the correct IP,123.4.5.6
What could be causing this? When I try to connect using a web browser I get the same behavior (using the IP is fine, using the hostname fails)..?
When I run nslookup;
C:\Windows\system32>nslookup myserver Server: myserver Address: 123.4.5.6 *** myserver can't find myserver: Non-existent domain
The output from
ipconfig /all
:Windows IP Configuration Host Name . . . . . . . . . . . . : D004 Primary Dns Suffix . . . . . . . : mydomain.local Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : mydomain.local Ethernet adapter Local Area Connection 3: Connection-specific DNS Suffix . : mydomain.local Description . . . . . . . . . . . : Intel(R) Ethernet Connection I217-LM Physical Address. . . . . . . . . : 34-17-EB-AB-C4-74 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IPv4 Address. . . . . . . . . . . : 192.168.23.108(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Tuesday, 5 August 2014 12:29:17 PM Lease Expires . . . . . . . . . . : Saturday, 9 August 2014 12:29:16 PM Default Gateway . . . . . . . . . : 192.168.23.1 DHCP Server . . . . . . . . . . . : 192.168.16.5 DNS Servers . . . . . . . . . . . : 192.168.16.5 192.168.16.2 Primary WINS Server . . . . . . . : 192.168.16.2 NetBIOS over Tcpip. . . . . . . . : Enabled
So I've tried using 123.4.5.6 as the DNS server (its running its own DNS but this doesnt seem to work). I've added 123.4.5.6 myserver to the
hosts
and thelmhosts
files-
I say Reinstate Monica almost 10 yearsIs
myserver
on your local network or somewhere else such that traffic has to be routed to get to it? Any chance you could post the output of theIPCONFIG /all
command as run from your machine? -
NightWolf almost 10 years
myserver
is somewhere else -traffic needs to be routed to get to it. Added IPCONFIG /all to the question -
I say Reinstate Monica almost 10 yearsCan you
PING myserver
then run the commandNBTSTAT -n
and post the result?
-