No such host is known socket connection

前端 未结 3 995
野的像风
野的像风 2020-12-19 10:34

I\'m trying to work with this library for telnet connections. I have called the function correctly and it executes the code below but fails giving the following error:

3条回答
  •  梦毁少年i
    2020-12-19 11:32

    I'm going to put this answer in here for people who are getting this error like me, who never seemed to find an answer:

    If you're trying to grab a client hostname from the DNS server within your company's network using: Dns.GetHostEntry(ClientIP) and each time you keep getting the "No such host is known socket connection error," your DNS server may not have Reverse Lookup Zones set for the IP range you're passing in code.

    For example, I have a program that works with our web application that captures the computer name and IP address of the employee submitting a help request. It worked if the computer using the application was on a vlan that was in the reverse lookup zone.

    If you have access to your domain's DNS server, add reverse lookup zones for all of the IP addresses that you use on your domain, or have your network administrator do it.

    Always have a try catch around it, just in case you have a situation where someone accesses your webapp from outside of your network.

    Knowing this would have saved me hours of frustration.

提交回复
热议问题