Telnet - Connection refused when using hostname, connects fine with IP

11,103

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.

Share:
11,103

Related videos on Youtube

NightWolf
Author by

NightWolf

Updated on September 18, 2022

Comments

  • NightWolf
    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 of myserver

    Running telnet 123.4.5.6 8080 works fine

    However when I try to use the server's hostname it fails to connect;

    telnet myserver 8080 fails. Yet a

    ping 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 the lmhosts files

    • I say Reinstate Monica
      I say Reinstate Monica almost 10 years
      Is 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 the IPCONFIG /all command as run from your machine?
    • NightWolf
      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
      I say Reinstate Monica almost 10 years
      Can you PING myserver then run the command NBTSTAT -n and post the result?